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.73.tar.gz
(11.5 kB
view details)
Built Distribution
onestep-0.1.73-py3-none-any.whl
(16.3 kB
view details)
File details
Details for the file onestep-0.1.73.tar.gz
.
File metadata
- Download URL: onestep-0.1.73.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.10 Linux/5.15.0-1035-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39e38178b0e94a4d4df4a68e75b6f9e6a72b78a74eafecab8ab99a0bb5b3b031 |
|
MD5 | 3f106ce517080e9c572f550163e425ef |
|
BLAKE2b-256 | b571de2207db1f476cfe2dc951e27949a9452bf63e1da8850ee2e42c13a376aa |
File details
Details for the file onestep-0.1.73-py3-none-any.whl
.
File metadata
- Download URL: onestep-0.1.73-py3-none-any.whl
- Upload date:
- Size: 16.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.10 Linux/5.15.0-1035-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85bae1eb9745b8616b16a511fd0e0d4d06fe5f3c7bb302677fd47d43a11298d0 |
|
MD5 | 3b5c0c38b47e61533eb525e2d451c260 |
|
BLAKE2b-256 | 05ffd400c5c1ad90ce23b5fca991ace83888440a3130fd696c85f60b381e4608 |