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.2.tar.gz
(11.5 kB
view details)
Built Distribution
onestep-0.1.2-py3-none-any.whl
(15.6 kB
view details)
File details
Details for the file onestep-0.1.2.tar.gz
.
File metadata
- Download URL: onestep-0.1.2.tar.gz
- Upload date:
- Size: 11.5 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 | 7d2dcbf34c6487442adaa471606891b6e912b31fe3c27959cbfc652280f98eb4 |
|
MD5 | 281124d784719f98128040a7bee2f19b |
|
BLAKE2b-256 | b0aab050f5fb49e0a9337e5629daebe7955e1bcb0d554cb7d35765c2f69656e4 |
File details
Details for the file onestep-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: onestep-0.1.2-py3-none-any.whl
- Upload date:
- Size: 15.6 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 | a79b3a389126abd5b3333300a47604bc98a35feb8435c2265626854880cc850c |
|
MD5 | 06898fadac81ad3b4c1acd4c6e4a80da |
|
BLAKE2b-256 | 34c7c6d8ea1bf4d2d2ddabb87ef804f71ff39ebd2e6a9653f950d41992747d9e |