Skip to content

Instantly share code, notes, and snippets.

@smetj
Last active August 21, 2016 15:27
Show Gist options
  • Save smetj/c8821f9b1a1303b00663e84be63281ec to your computer and use it in GitHub Desktop.
Save smetj/c8821f9b1a1303b00663e84be63281ec to your computer and use it in GitHub Desktop.
Hello world (wishbone.readthedocs.org)
from wishbone.module.testevent import TestEvent
from wishbone.module.stdout import STDOUT
from wishbone.router import Default
from wishbone.actor import ActorConfig
input_config = ActorConfig("input")
output_config = ActorConfig("output")
router = Default()
router.registerModule(TestEvent, input_config, {"message": "Hello world!"})
router.registerModule(STDOUT, output_config)
router.connectQueue("input.outbox", "output.inbox")
router.start()
try:
router.block()
except KeyboardInterrupt:
router.stop()
modules:
input:
module: wishbone.input.testevent
arguments:
message : Hello World!
stdout:
module: wishbone.output.stdout
routingtable:
- input.outbox -> stdout.inbox
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment