No project description provided
Project description
仅需一步,轻松实现分布式异步任务。
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.3.tar.gz
(12.5 kB
view details)
Built Distribution
onestep-0.3.3-py3-none-any.whl
(18.6 kB
view details)
File details
Details for the file onestep-0.3.3.tar.gz
.
File metadata
- Download URL: onestep-0.3.3.tar.gz
- Upload date:
- Size: 12.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.10.13 Linux/6.2.0-1015-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e88dbfbea0f435956c93836311f721d85f0a24ce1f913529c181559d802decce |
|
MD5 | 863218702ca7ac44b076c395144d893b |
|
BLAKE2b-256 | 8cb852684c18c69e9bbd651b996d3909afea0db4bebccc1846e3005240901913 |
File details
Details for the file onestep-0.3.3-py3-none-any.whl
.
File metadata
- Download URL: onestep-0.3.3-py3-none-any.whl
- Upload date:
- Size: 18.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.10.13 Linux/6.2.0-1015-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a427ae383c6eef3d017715558735dd00687b9232c2749b01a280fc98a502af6 |
|
MD5 | 3dbd921f8aeb538c95de9b1b3ad21166 |
|
BLAKE2b-256 | 58411bd734ed9cd49f0ecaf0c01a8976486a0eb12f9d6e4caebdca6f5e220a7c |