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.3.0.tar.gz
(11.4 kB
view details)
Built Distribution
onestep-0.3.0-py3-none-any.whl
(16.6 kB
view details)
File details
Details for the file onestep-0.3.0.tar.gz
.
File metadata
- Download URL: onestep-0.3.0.tar.gz
- Upload date:
- Size: 11.4 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 | 0d3bd804e41da4e8e6d93e234032c84f9da35fecd88cc614f9bc20af2903d7cf |
|
MD5 | 960c7e430cc9ba6a59ba07814b490b46 |
|
BLAKE2b-256 | 9c4d7609b966138b04445351b8ece79b4900cc60fc28f5c75061f7fad2a8105f |
File details
Details for the file onestep-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: onestep-0.3.0-py3-none-any.whl
- Upload date:
- Size: 16.6 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 | ec008a442cbd0ec4319fc5ece0b21829d657a03386599f919b4ffdf0d65434c1 |
|
MD5 | 91688a724df1044de65f0fae19b524b4 |
|
BLAKE2b-256 | ff1815ba77cdddc48e1f47daf26e7a2035de32f2aa6b2e520ea223ad3b897494 |