No project description provided
Project description
仅需一步,轻松实现分布式异步任务。
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.3.4.tar.gz
(12.8 kB
view details)
Built Distribution
onestep-0.3.4-py3-none-any.whl
(18.8 kB
view details)
File details
Details for the file onestep-0.3.4.tar.gz
.
File metadata
- Download URL: onestep-0.3.4.tar.gz
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.13 Linux/6.2.0-1016-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5911180e651ccfa92261315aaa316fe736c36c2ef6f3244fb6fe5eba4bda1431 |
|
MD5 | c6f254e64541ff3e3b87a28d8c156905 |
|
BLAKE2b-256 | fabff8d81a9a1bdaa37a21d3e91de834491dd9f465292024978b54faee53fa0b |
File details
Details for the file onestep-0.3.4-py3-none-any.whl
.
File metadata
- Download URL: onestep-0.3.4-py3-none-any.whl
- Upload date:
- Size: 18.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.13 Linux/6.2.0-1016-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05cb56e056a01548d26c6ed4e426fc32e0fa805320911e140ebed624e958c3cd |
|
MD5 | bc4c28f31c1596c6ba098ac5b6e37425 |
|
BLAKE2b-256 | b2a43837457554ede247b9b9cd275f5c3b109314692c7799bf68d2a54cb59fd7 |