kadence/quasar~ QuasarRules

Implements the handlers for Quasar message types

Constructor

new QuasarRules(quasar)

Parameters:
NameTypeDescription
quasarmodule:kadence/quasar~QuasarPlugin

Methods

(static) shouldRelayPublication(request, attenuatedBloomFilter)

Returns a boolean indicating if we should relay the message to the contact

Parameters:
NameTypeDescription
requestAbstractNode~request
attenuatedBloomFilterarray

List of topic bloom filters

publish(request, response, next)

Upon receipt of a PUBLISH message, we validate it, then check if we or our neighbors are subscribed. If we are subscribed, we execute our handler. If our neighbors are subscribed, we relay the publication to ALPHA random of the closest K. If our neighbors are not subscribed, we relay the publication to a random contact

Parameters:
NameTypeDescription
requestAbstractNode~request
responseAbstractNode~response
nextAbstractNode~next

subscribe(request, response)

Upon receipt of a SUBSCRIBE message, we simply respond with a serialized version of our attenuated bloom filter

Parameters:
NameTypeDescription
requestAbstractNode~request
responseAbstractNode~response

update(request, response, next)

Upon receipt of an UPDATE message we merge the delivered attenuated bloom filter with our own

Parameters:
NameTypeDescription
requestAbstractNode~request
responseAbstractNode~response
nextAbstractNode~next