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

Uploaded Source

Built Distribution

onestep-0.1.3-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: onestep-0.1.3.tar.gz
  • Upload date:
  • Size: 11.5 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.3.tar.gz
Algorithm Hash digest
SHA256 3d487b3986ca947700c4d920105420129027d393a4ff72a96b93a393bde8430b
MD5 ac84e05f47131636390acbb5e3bf81f2
BLAKE2b-256 5b72c6da93379d78688022e90ced6802f53f3a7042717af751d3b25f1a020c52

See more details on using hashes here.

File details

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

File metadata

  • Download URL: onestep-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 15.5 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c17dce2d1973fc21e4a3ed91ab4784a1adcce8b6cb2644859515913eaa3d4182
MD5 c5a2c85363e8763cd20917cca69aabd8
BLAKE2b-256 f6fe4d23450d0dd82177177633d1e70c3d62631e52d5db3fe9f5e7f40849b64e

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