No project description provided
Project description
OneStep
仅需一步,轻松实现分布式异步任务。
Brokers
- MemoryBroker
- CronBroker
- WebHookBroker
- RabbitMQBroker
- RedisBroker
- KafkaBroker
example
from onestep import step, WebHookBroker
# 对外提供一个webhook接口,接收外部的消息
@step(from_broker=WebHookBroker(path="/push"))
def waiting_messages(message):
print("收到消息:", message)
if __name__ == '__main__':
step.start(block=True)
from onestep import step, CronBroker
# 每3秒触发一次任务
@step(from_broker=CronBroker("* * * * * */3", a=1))
def cron_task(message):
assert message.body == {"a": 1}
return message
if __name__ == '__main__':
step.start(block=True)
更多例子请参阅:examples
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
onestep-0.1.7.tar.gz
(12.0 kB
view details)
Built Distribution
onestep-0.1.7-py3-none-any.whl
(16.1 kB
view details)
File details
Details for the file onestep-0.1.7.tar.gz
.
File metadata
- Download URL: onestep-0.1.7.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.10.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 259571c09c7032cadbf3fe740bde6a9145aab7f474807677a0e5087f5ff5c6cf |
|
MD5 | 5a984588caecd0665f7b4ddfc6ac7ed6 |
|
BLAKE2b-256 | 989e156008d4fa975762914cbf05f98a3d1958f5cd1517027c3458f9f8381498 |
File details
Details for the file onestep-0.1.7-py3-none-any.whl
.
File metadata
- Download URL: onestep-0.1.7-py3-none-any.whl
- Upload date:
- Size: 16.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.10.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b7e821ff360d8a5ed9493f9e0723a160e9d541543688a8e26ee75186e06d2be |
|
MD5 | 058f76557436069b15e7deeeea60b2af |
|
BLAKE2b-256 | 93e7b1b9e429aa141fd40ee3d2edab2dc73734cae683238fdfdd36483de44aca |