UNPKG

456 Btext/coffeescriptView Raw
1logger = require 'torch'
2postal = require 'postal'
3
4postal.subscribe {
5 channel: 'module.run/stop'
6 topic: 'request.#'
7 callback: (message, envelope) ->
8 logger {message, envelope}
9}
10
11#postal.publish {
12 #channel: 'module.run/stop'
13 #topic: 'request.1'
14 #data: 'hello'
15#}
16
17postal.linkChannels(
18 {channel: 'system.kill', topic: '#'}
19 {channel: 'module.run/stop'}
20)
21
22postal.publish {
23 channel: 'system.kill'
24 topic: 'request.1'
25 data: 'hello'
26}