yoctotta-service-broker

1.0.2 • Public • Published

yoctotta-service-broker

Its a service broker that allows for registering services and using a Pub/Sub mechanism in node js. E.G.

const broker = new LocalServiceBroker();

broker
        .bind(new LocalService("test"))
        .then(() => broker.get("test"))
        .then((service) => {
          service.transport.subscribe("testChannel", (msg) => {
            console.log(msg);
            resolve(msg);
          });
          service.transport
            .publish({
              messageId: "test1",
              channel: "testChannel",
              data: { msg: "Some Data" },
              msgTime: new Date(),
              msgType: "",
            })
            .then(
              () => console.log("Published"),
              (reason) => console.log(reason)
            );
        })

Readme

Keywords

none

Package Sidebar

Install

npm i yoctotta-service-broker

Weekly Downloads

2

Version

1.0.2

License

ISC

Unpacked Size

16.2 kB

Total Files

11

Last publish

Collaborators

  • yspl