Bus module
WORK IN PROGRESS
Simpe wrapper over the EventEmitter
to send and listen to messages.
Use
Listen to a channel:
base.events.listen(productsChannel, (msg) => {
if (msg.type === 'CREATE') {
base.workers.enqueue('indexProduct', msg.data);
}
});
Send messages to a channel:
base.events.send(productsChannel, 'CREATE', productData);