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.3a1.tar.gz
(12.5 kB
view hashes)
Built Distribution
onestep-0.3.3a1-py3-none-any.whl
(18.6 kB
view hashes)
Close
Hashes for onestep-0.3.3a1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 305440a42d72e323c6d8e12746c298ce87e5a5202487a68fe64d4a71258f684f |
|
MD5 | 97e53565db87d43d8380898a256583ad |
|
BLAKE2b-256 | cef162e3fc2ebf5ab011df3a91799d0a237be27ef070fe0ed95df0459674e754 |