@peerbit/pubsub
TypeScript icon, indicating that this package has built-in type declarations

4.0.4 • Public • Published

Direct Sub

Pubsub protocol built on top of Direct Stream

Features

  • Accurate

     .getSubscribers(topic)

    method based on aggregated subscriber info, not only from immediate peers.

  • Efficient content routing through an approximate path finding algorithm

     .publish(data, { topics: ["a","b"]})

    will try to find the subscribers of "a" and "b" and send messages with the shortest path in the network.

  • Packet prioritization. Data packages can be sent with different priority. That allows some traffic to pass through the traffic faster than other. This is useful in case of congestion

  • Mode'd delivery. Packages can be sent with different delivery mode 'Acknowledge' (wait for acknowledgement from all known subscribers), 'Seek' (find new subscribers for a topic), 'Silent' (just deliver).

  • Redundancy in data delivery. Data packages can be sent with different redundancy. This means that you can choose to send some packages only in one path (the fastest) or send a package in the 'N' fastest paths (this gives you a redundancy degree of 'N'). This feature is useful when you want to adapt delivery for unstable networks or when you want to make sure that some messages are delivered with high probability (without waiting for Acknowledgemts and retry)

Protocol specification (TODO)

Currently the protocol itself is not specificed more than as in this implementation with messages types found here and here. Message handling logic can be found here and here.

Readme

Keywords

Package Sidebar

Install

npm i @peerbit/pubsub

Weekly Downloads

506

Version

4.0.4

License

MIT

Unpacked Size

95.8 kB

Total Files

16

Last publish

Collaborators

  • marcus.pousette