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.2.tar.gz
(12.3 kB
view details)
Built Distribution
onestep-0.3.2-py3-none-any.whl
(18.0 kB
view details)
File details
Details for the file onestep-0.3.2.tar.gz
.
File metadata
- Download URL: onestep-0.3.2.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.10.12 Linux/5.15.0-1042-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6dc77fc4534f586cdfb11cadf178a7bdba556589d228ef24dd797ac1eb966dd |
|
MD5 | 6a78fd49bea6e7355492a3467b3f8cce |
|
BLAKE2b-256 | fc7656e7d419e4d01bca42e4684e250da13382c04ce1ee14cae36d4543f98add |
File details
Details for the file onestep-0.3.2-py3-none-any.whl
.
File metadata
- Download URL: onestep-0.3.2-py3-none-any.whl
- Upload date:
- Size: 18.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.10.12 Linux/5.15.0-1042-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 856f4381bacda88d5b64bee320a0705fa79d8c65054ba7efca9df17d4369907b |
|
MD5 | 202ab3b1983c181b4ede546888d42c2e |
|
BLAKE2b-256 | dda99f2393b7b036a842a35fb9f8c7d9ffd863a5ba0c0cc82044e281218e3c30 |