estreamer
v1.1.0
Published
A Client that connects to an Event broker to send/receive events via a TCP socket
Downloads
3
Readme
Event Streamer
This is a simple implementation of a event streaming client. This client would connect to a EventBus
and subscribe/publish events.
Usage
To use the event streamer you will first have to require it in and call the constructor, as shown below.
const EventClient = require('EventStreamer');
const Seeker = new EventClient("127.0.0.1", 7070);
The constructor takes 2 parameters the first being a Host
and the second being the Port
which the client should try and connect to.
Parameter List
Host
is a String
Port
is a integer
Methods
Subscribe(_eName)
This method will send a event to the EventBus
with the service that the client wishes to subscribe to.
Seeker.Subscribe("Example");
Parameter List
_eName
is a String
Publish(_eName, _eData)
This method will send a event with any data to the EventBus
with the service that the client wishes to publish to.
Seeker.Publish("Example", {Msg: "Sample_Event_Publish"})
Parameter List
_eName
is a String
_eData
is a Any