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

Uploaded Source

Built Distribution

onestep-0.1.74-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: onestep-0.1.74.tar.gz
  • Upload date:
  • Size: 11.5 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.74.tar.gz
Algorithm Hash digest
SHA256 a017f5287739549a745e1b41061bb00de064e5cb45c409912312ecd19f0437d3
MD5 aefe107b5a8653b313650f33b3aaabc8
BLAKE2b-256 b5aa842e98d911945e4c0ec4749e8fcd04c9bb5920a604b0d92732049a6dc77d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: onestep-0.1.74-py3-none-any.whl
  • Upload date:
  • Size: 16.4 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.74-py3-none-any.whl
Algorithm Hash digest
SHA256 5f28ba18f12c6e8ea331fbcbbdb65330ffde37bc0f352a8e9ed9e24131df6358
MD5 363c0ab40bf0692ba84dcf5e377128ab
BLAKE2b-256 db14a8f0d25e85562bf2fc595dddc8dfe11cbfea58b97308597972a0e79515c1

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