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

Uploaded Source

Built Distribution

onestep-0.3.1-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: onestep-0.3.1.tar.gz
  • Upload date:
  • Size: 11.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

Hashes for onestep-0.3.1.tar.gz
Algorithm Hash digest
SHA256 d4c41acd04dec57277ef8289dfdc93e3fc6baa0e3590e0b972796fa80130163a
MD5 99c753fdd7a5d7650c2a77c1864053ea
BLAKE2b-256 2f8f8282daeef8db0f4d10b4e82ec7e12123794c0c32155631679d5aa689cebb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: onestep-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 17.5 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

Hashes for onestep-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2377725471e1cc85969cf8f0c7ea90a883a68fe92e74928bf7ec020bc408bc29
MD5 ce77017a3e28ece58050c774c8920cb5
BLAKE2b-256 441ff1bca79bfb3352d6a40a7188e6385595f6672c8d4435f3122ff3d2d986f2

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