Class: QuasarPlugin

module:kadence/quasar~ QuasarPlugin

Implements the primary interface for the publish-subscribe system and decorates the given node object with it's public methods

new QuasarPlugin(node)

Parameters:
Name Type Description
node KademliaNode
Source:

Members


neighbors

Returns our ALPHA closest neighbors
Properties:
Name Type Description
neighbors Array.<Bucket~contact>
Source:

Methods


hasNeighborSubscribedTo(topic)

Check if our neighbors are subscribed to the topic
Parameters:
Name Type Description
topic string Topic to check subscription
Source:
Returns:
Type
boolean

isSubscribedTo(topic)

Check if we are subscribed to the topic
Parameters:
Name Type Description
topic string Topic to check subscription
Source:
Returns:
Type
boolean

pullFilterFrom(contact, callback)

Requests the attenuated bloom filter from the supplied contact
Parameters:
Name Type Description
contact Bucket~contact
callback function
Source:

pullFilters( [callback])

Requests neighbor bloom filters and merges with our records
Parameters:
Name Type Argument Description
callback function <optional>
Source:

pushFilters( [callback])

Notifies neighbors that our subscriptions have changed
Parameters:
Name Type Argument Description
callback function <optional>
Source:

pushFilterTo(contact, callback)

Sends our attenuated bloom filter to the supplied contact
Parameters:
Name Type Description
contact Bucket~contact
callback function
Source:

quasarPublish(topic, contents [, options] [, callback])

Publishes the content to the network by selecting ALPHA contacts closest to the node identity (or the supplied routing key). Errors if message is unable to be delivered to any contacts. Tries to deliver to ALPHA contacts until exhausted.
Parameters:
Name Type Argument Description
topic string Identifier for subscribers
contents object Arbitrary publication payload
options object <optional>
Properties
Name Type Argument Description
routingKey string <optional>
Publish to neighbors close to this key instead of our own identity
callback QuasarPlugin~quasarPublishCallback <optional>
Source:

quasarSubscribe(topics, handler)

Publishes the content to the network
Parameters:
Name Type Description
topics string | Array.<string> Identifier for subscribers
handler QuasarPlugin~quasarSubscribeHandler
Source: