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.76.tar.gz
(11.8 kB
view details)
Built Distribution
onestep-0.1.76-py3-none-any.whl
(16.6 kB
view details)
File details
Details for the file onestep-0.1.76.tar.gz
.
File metadata
- Download URL: onestep-0.1.76.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.11 Linux/5.15.0-1035-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c0f178d7e7bc56ef53b8e628b10c78fe1f847a6ad9ce36f1724bc078bb4c2bc |
|
MD5 | 938e7a92879960f17ee4df7568d057cd |
|
BLAKE2b-256 | d45b72f5ceff2724d73209888cf89affcc2fb57f45274d37f68b3f054ab8f06f |
File details
Details for the file onestep-0.1.76-py3-none-any.whl
.
File metadata
- Download URL: onestep-0.1.76-py3-none-any.whl
- Upload date:
- Size: 16.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.11 Linux/5.15.0-1035-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a67107658b2d58e94f8e2c6839442b6c5cdf17d05a9e7abaf792cd816f9c7959 |
|
MD5 | 8e2223139736e8b8696ac4ffd14ffa04 |
|
BLAKE2b-256 | d6b7636fa6a8ba57feb702c70f6a82d2d3fa1aedfd3e52bec574a5002a4637be |