Commit Graph

6 Commits

Author SHA1 Message Date
vyzo 8b423348a0 add ValidatorData field to Message
Useful for passing data from the validation to the application.
2019-11-15 20:16:58 +02:00
Adin Schmahmann 686c928d4e pubsub and topic methods now return error if the pubsub context has been cancelled instead of hanging 2019-11-04 03:52:39 -05:00
Adin Schmahmann ad97d9bf17 fixed closed Topic handles still being able to perform some actions on the topic 2019-11-02 19:28:44 -04:00
Adin Schmahmann 899f9cd62b fixed Topic close error 2019-11-01 17:12:23 -04:00
Adin Schmahmann f9c26c2e68 Added libp2p discovery capabilities to PubSub.
When the WithDiscovery option is passed to PubSub then PubSub will be able to search for more peers that are interested in our topics.

This includes the ability for Publishes (via Topic.Publish()) to block until the router is ready to publish. When a router is ready is currently defined by a combination of a user defined MinTopicSize function (passed into topic.Publish via the WithReadiness publish option) and the properties of the pubsub router used. The discovery tests show example usage.
2019-10-31 16:39:18 -04:00
Adin Schmahmann 5ef7439d71 interface: New Topic + TopicEventHandlers objects.
Added PubSub.Join(topic) that returns a Topic object. This object can be Subscribed and Published to as well as to get a TopicEventHandler for topic events. This means that the Subscription object will no longer handle PeerEvents and that PubSub's Publish and Subscribe functions are deprecated.
2019-10-31 15:37:44 -04:00