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.2.1.tar.gz
(10.9 kB
view details)
Built Distribution
onestep-0.2.1-py3-none-any.whl
(15.6 kB
view details)
File details
Details for the file onestep-0.2.1.tar.gz
.
File metadata
- Download URL: onestep-0.2.1.tar.gz
- Upload date:
- Size: 10.9 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 | 705e4c6b52fd8d943eb926feaf019f781b9bda521e8e53d7588c7c9bfc77d9ce |
|
MD5 | e31d193e18b1079605b3c20c4eabd230 |
|
BLAKE2b-256 | d796ec5e258405262de6c3342e33a6fd1b61ba4fab4dce120423513684860a7d |
File details
Details for the file onestep-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: onestep-0.2.1-py3-none-any.whl
- Upload date:
- Size: 15.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 | fdafd673eda5fa07af4765b37f896200cc63558adfb6d838ea7d71eaefc85de5 |
|
MD5 | 04dc5414781063c2d9c7ccc1066a3afe |
|
BLAKE2b-256 | 15434d02b8c5abf22502678bcf95587fb640c21d4be5950f9fb9ea1b48c97eb5 |