Skip to main content

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


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

Uploaded Source

Built Distribution

onestep-0.3.21-py3-none-any.whl (18.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: onestep-0.3.21.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.10.13 Linux/6.2.0-1014-azure

File hashes

Hashes for onestep-0.3.21.tar.gz
Algorithm Hash digest
SHA256 c80a716761592c646db223afa6ab912a9a6988e60b0244f5e7ef99e643b89fe9
MD5 a44c4e1b379057778f9272bdfab358f6
BLAKE2b-256 8b2d06aa892c1c7251c0394b49ec5fd785974c36446ad22fdbbb951ec1700de6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: onestep-0.3.21-py3-none-any.whl
  • Upload date:
  • Size: 18.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.10.13 Linux/6.2.0-1014-azure

File hashes

Hashes for onestep-0.3.21-py3-none-any.whl
Algorithm Hash digest
SHA256 06c0c3940248f05542ec5ef227f6dc7125bdc5200e67e3452245fd439238b981
MD5 0f58e89c870ad279d1b71c5fbbea71ce
BLAKE2b-256 3edfee2a3a833cc27310a7061304bcced054d46279b82d6ec516a4cbd07f5679

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