Skip to main content

No project description provided

Project description

OneStep

Test Package version Supported Python versions
仅需一步,轻松实现分布式异步任务。

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


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.75.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

onestep-0.1.75-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file onestep-0.1.75.tar.gz.

File metadata

  • Download URL: onestep-0.1.75.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.10.10 Linux/5.15.0-1035-azure

File hashes

Hashes for onestep-0.1.75.tar.gz
Algorithm Hash digest
SHA256 4ccb7d785b15b4aa04f562968987f68da731baf8ecd3285b239fb38d8fe9b130
MD5 4dafbbf3f336ee232670a689c067bce9
BLAKE2b-256 05654f4a8191ddba2f1ab1ac57eeafd5dfb1a5b377b474dc0527583f7d185d80

See more details on using hashes here.

File details

Details for the file onestep-0.1.75-py3-none-any.whl.

File metadata

  • Download URL: onestep-0.1.75-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.10 Linux/5.15.0-1035-azure

File hashes

Hashes for onestep-0.1.75-py3-none-any.whl
Algorithm Hash digest
SHA256 c0b232d86b5069eb5f3effac346a72fe8c62fca4a10ed41e862efe5de6eb3174
MD5 9332064b845837b4b04a55e82c3889ae
BLAKE2b-256 ce740a15f22c6b5bb8259051589f297100174d1a7fce738862dabbe18d70378c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page