Constructor
new QuasarRules(quasar)
Parameters:
Name | Type | Description |
---|---|---|
quasar | module:kadence/quasar~QuasarPlugin |
- Source
Methods
(static) shouldRelayPublication(request, attenuatedBloomFilter)
Returns a boolean indicating if we should relay the message to the contact
Parameters:
Name | Type | Description |
---|---|---|
request | AbstractNode~request | |
attenuatedBloomFilter | array | List of topic bloom filters |
- Source
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:
Name | Type | Description |
---|---|---|
request | AbstractNode~request | |
response | AbstractNode~response | |
next | AbstractNode~next |
- Source
subscribe(request, response)
Upon receipt of a SUBSCRIBE message, we simply respond with a serialized version of our attenuated bloom filter
Parameters:
Name | Type | Description |
---|---|---|
request | AbstractNode~request | |
response | AbstractNode~response |
- Source
update(request, response, next)
Upon receipt of an UPDATE message we merge the delivered attenuated bloom filter with our own
Parameters:
Name | Type | Description |
---|---|---|
request | AbstractNode~request | |
response | AbstractNode~response | |
next | AbstractNode~next |
- Source