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

Uploaded Source

Built Distribution

onestep-0.1.81-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: onestep-0.1.81.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.10.11 Linux/5.15.0-1036-azure

File hashes

Hashes for onestep-0.1.81.tar.gz
Algorithm Hash digest
SHA256 3bea1d8fc640b75fba668794d2716b5a8fe06002ebc9c7dcf52c5010835cd23a
MD5 2b6cd579fafb4eee60c0fde1186f41b4
BLAKE2b-256 0227738736ceeaa51e2501c52e1af47dc1377b1a4ed470d28d61fd87bbb8c5e1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: onestep-0.1.81-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.10.11 Linux/5.15.0-1036-azure

File hashes

Hashes for onestep-0.1.81-py3-none-any.whl
Algorithm Hash digest
SHA256 9e840b21795b205d6d4b6cdc4fdce8350f9818fa9b063039043e731a21d08dd6
MD5 7085be4001cb36a50aeae24d5df43456
BLAKE2b-256 782bacf9c2225ce1e62657d72d165711ef0c0eaa351fd603cb93ebdeef7fd19a

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