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.6.tar.gz
(11.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
onestep-0.1.6-py3-none-any.whl
(15.9 kB
view details)
File details
Details for the file onestep-0.1.6.tar.gz.
File metadata
- Download URL: onestep-0.1.6.tar.gz
- Upload date:
- Size: 11.8 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 |
e8c0697becef83f7ada8f17c251e349fba2adee6f488bef6992608e90cf0214d
|
|
| MD5 |
7c1dfa33b0d6068c6a039857fddb2168
|
|
| BLAKE2b-256 |
1c31b682c6fb4580f28b119ee33c4d70e8866da002f17ab255043da989163396
|
File details
Details for the file onestep-0.1.6-py3-none-any.whl.
File metadata
- Download URL: onestep-0.1.6-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 |
edbeb7fefaa2b2bde29b1bea30c9d3f92d77431ad94591b12aafb9b1a179bd41
|
|
| MD5 |
51088db8fe86f29aa2a5cc63712b9d67
|
|
| BLAKE2b-256 |
163fc4ee6358ab93f42b1d3cd9bc97225b4e41b8f47ab6a3891bb12844ed5a5f
|