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
Metadata
Release files for onestep 0.1.73
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| onestep-0.1.73.tar.gz | 11.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| onestep-0.1.73-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.8 kB
Release files / onestep-0.1.73.tar.gz
| Download URL | onestep-0.1.73.tar.gz |
|---|---|
| Size | 11.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
39e38178b0e94a4d4df4a68e75b6f9e6a72b78a74eafecab8ab99a0bb5b3b031
|
|
BLAKE2b-256 checksum How to use checksums |
b571de2207db1f476cfe2dc951e27949a9452bf63e1da8850ee2e42c13a376aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.10.10 Linux/5.15.0-1035-azure
|
Release files / onestep-0.1.73-py3-none-any.whl
| Download URL | onestep-0.1.73-py3-none-any.whl |
|---|---|
| Size | 16.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
85bae1eb9745b8616b16a511fd0e0d4d06fe5f3c7bb302677fd47d43a11298d0
|
|
BLAKE2b-256 checksum How to use checksums |
05ffd400c5c1ad90ce23b5fca991ace83888440a3130fd696c85f60b381e4608
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.10.10 Linux/5.15.0-1035-azure
|