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

Uploaded Source

Built Distribution

onestep-0.2.0-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: onestep-0.2.0.tar.gz
  • Upload date:
  • Size: 11.0 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.2.0.tar.gz
Algorithm Hash digest
SHA256 2350145deca4588bd4e69e2dc8da3077fb7df5a7ddf08fafc68fa26ab2787e8a
MD5 08bc2378b5107138f108fdec2e81af82
BLAKE2b-256 909e5c36f2cde7f1c1d97be6d06edc6ef61ea3335b7ad8a62fc67ffd02fef386

See more details on using hashes here.

File details

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

File metadata

  • Download URL: onestep-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 15.6 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 edbb433eeb4b618b37b4cb111a002734763acd818c2726a15003abe125dce562
MD5 a17a0816a53cf128ddaea2cea538561a
BLAKE2b-256 b7e1c7924fcb2429821d27d4577df2e92bfe68ef6af6b55994d06202c7cf2d94

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