1 | logger = require 'torch'
|
2 | postal = require 'postal'
|
3 |
|
4 | postal.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 |
|
17 | postal.linkChannels(
|
18 | {channel: 'system.kill', topic: '#'}
|
19 | {channel: 'module.run/stop'}
|
20 | )
|
21 |
|
22 | postal.publish {
|
23 | channel: 'system.kill'
|
24 | topic: 'request.1'
|
25 | data: 'hello'
|
26 | }
|