Here is the API:
service Broker {
rpc Publish(PublishMessages) returns (Empty) {}
rpc Subscribe(Subscription) returns (stream ReceivedMessage) {}
}
Visit grpc.io if you don't know what is it.
This code is working on node.js v7.0.0
git clone git@github.com:inre/pubsub.git pubsub && cd pubsub
npm i
Start/stop the broker:
npm start
npm stop
Start in debug:
npm run dev
Subcribe to topics:
npm run sub topic1 topic2 topic3
Publish to topic:
npm run pub topic1 "payload"
npm stop
gem install cucumber
gem install thread
npm test