Skip to content
On this page

MemoryBroker

MemoryBroker是一个基于Queue的内存消息队列,用于在同一个进程内部的消息传递。

python
from onestep import step
from onestep.broker import MemoryBroker

broker = MemoryBroker()
broker.queue.put("test")  # 模拟手动发一条消息


@step(from_broker=broker)
def step1(message):
    print(message.body)


step.start(block=True)

Released under the MIT License.