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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: onestep-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 387575bcc46eba0c4c09bd9a252a46986d66dc5cea0ebc09b4b7af9dad68cd6f
MD5 4e843b4b0fe8cf09dcc687c841728ac5
BLAKE2b-256 c4da4650a490bd37282b693fa7be661b4f0e9582791120dbc689f337beaf1fd5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: onestep-0.1.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 bc5ac9b0bf9b06868a7df0ef8bdcda0ee6ffc3e4907c77749f9f783f0b26a117
MD5 a3f7ea499842bd952f7d8270a0d4a25d
BLAKE2b-256 ebdc3886e391ae46d2452c65168129036f608ac687890f72468a31adfd74bf46

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