Open wilzbach opened 7 years ago
The following works now:
subscriber.subscribe("test1", "test2");
auto task = subscriber.listen((string channel, string message) {
writefln("channel: %s, msg: %s", channel, message);
});
conn.publish("test1", "Hello World!");
conn.publish("test2", "Hello from Channel 2");
runTask({
subscriber.subscribe("test-fiber");
subscriber.publish("test-fiber", "Hello from the Fiber!");
subscriber.unsubscribe();
});
channel: test1, msg: Hello World!
channel: test-fiber, msg: Hello from the Fiber!
channel: test2, msg: Hello from Channel 2
listen, trigger