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

Uploaded Source

Built Distribution

onestep-0.1.77-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for onestep-0.1.77.tar.gz
Algorithm Hash digest
SHA256 e843ae49df9ec6743d5b8fc40d97c79070d034cc89e72d960f86636cc283292e
MD5 c1755669396c089d532288c4d48a72c2
BLAKE2b-256 50becff03b868d1a5c6e2b608a36489a27ba4f9b84b7c7f70f4aa902ed94cfe1

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for onestep-0.1.77-py3-none-any.whl
Algorithm Hash digest
SHA256 280ddc4896d95c5bbc0cf1d357f308c4c13d461897515a45169cd0a4b677fce0
MD5 0ecb90bcf0160479a52ca2ee579c64e2
BLAKE2b-256 3469d29162624b1da37c2dddd3a05764dacb0dceaab95844179ebbfd3684498c

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