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.5.tar.gz
(11.7 kB
view details)
Built Distribution
onestep-0.1.5-py3-none-any.whl
(15.9 kB
view details)
File details
Details for the file onestep-0.1.5.tar.gz
.
File metadata
- Download URL: onestep-0.1.5.tar.gz
- Upload date:
- Size: 11.7 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 | 11b6dfa286120cfe0b61ff3d5af285266746883ab748993a99a398c80758a3b2 |
|
MD5 | 1522e3f5f263d2fea569a7e4875d016c |
|
BLAKE2b-256 | 64cbc9af59cd8d0b0812cc093c3e612cb312ee791dc46fc5587a9223847a102d |
File details
Details for the file onestep-0.1.5-py3-none-any.whl
.
File metadata
- Download URL: onestep-0.1.5-py3-none-any.whl
- Upload date:
- Size: 15.9 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 | cb087b87763f25580abb07bf5dbf39fca6aa493f4a6a1fb46c709eb956a667ee |
|
MD5 | b113466dab0a14cd62eefcbb495a8785 |
|
BLAKE2b-256 | 7dbac2b1b461093e09f0f49804e8cd7263c7d9d47c1e293dd4e714e733f57f0f |