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

Uploaded Source

Built Distribution

onestep-0.1.71-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: onestep-0.1.71.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.10.10 Darwin/22.3.0

File hashes

Hashes for onestep-0.1.71.tar.gz
Algorithm Hash digest
SHA256 5642a84d14ba0eee2a585713d65e806c5637eb817d9d6570e24ed1c2ce59df7b
MD5 5bd316f34cce61d990f6bf031f963668
BLAKE2b-256 0ca923489f6748a929f8e4c650e68d15c9564c6f6d26eabd3f2555d06cea5bd2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: onestep-0.1.71-py3-none-any.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.10.10 Darwin/22.3.0

File hashes

Hashes for onestep-0.1.71-py3-none-any.whl
Algorithm Hash digest
SHA256 4afe217eb9b36516b0524ebb328116ffb2b417b6655c8525e15fdb66583e3a71
MD5 ed49a7d5d7a74b489b56e40069f87abf
BLAKE2b-256 765ef83126a3c35b1b4d32825de924f2f4b3dce44a4b0d93c6024f7cbfe08dd2

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