Documentation ¶
Index ¶
- func NewRouter(host p2p.Node) *actor.PID
- func Start()
- func Stop()
- type NetworkPubSub
- func (nps *NetworkPubSub) Broadcast(topic string, message proto.Message) error
- func (nps *NetworkPubSub) NewSubscriberProps(topic string) *actor.Props
- func (nps *NetworkPubSub) RegisterTopicValidator(topic string, validatorFunc PubSubValidator, opts ...pubsub.ValidatorOpt) error
- func (nps *NetworkPubSub) Subscribe(ctx spawner, topic string, subscribers ...*actor.PID) *actor.PID
- func (nps *NetworkPubSub) UnregisterTopicValidator(topic string)
- type PubSub
- type PubSubValidator
- type SimulatedPubSub
- func (sb *SimulatedPubSub) Broadcast(topic string, message proto.Message) error
- func (sb *SimulatedPubSub) NewSubscriberProps(topic string) *actor.Props
- func (sb *SimulatedPubSub) RegisterTopicValidator(topic string, validatorFunc PubSubValidator, opts ...pubsub.ValidatorOpt) error
- func (sb *SimulatedPubSub) Subscribe(ctx spawner, topic string, subscribers ...*actor.PID) *actor.PID
- func (sb *SimulatedPubSub) UnregisterTopicValidator(topic string)
- type UnderlyingPubSub
- type UnderlyingSubscription
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type NetworkPubSub ¶
type NetworkPubSub struct {
// contains filtered or unexported fields
}
NetworkPubSub implements the broadcast interface necessary for the client
func NewNetworkPubSub ¶
func NewNetworkPubSub(pubsub *pubsub.PubSub) *NetworkPubSub
NewNetworkPubSub returns a NetworkBroadcaster that can be used to send messages.WireMessage across the p2p network using pubsub.
func NewWrappedPubsub ¶
func NewWrappedPubsub(pubsub UnderlyingPubSub) *NetworkPubSub
NewWrappedPubsub takes any pubsub that conforms to the `underlyingPubSub` interface and returns a wrapped NetworkPubSub
func (*NetworkPubSub) Broadcast ¶
func (nps *NetworkPubSub) Broadcast(topic string, message proto.Message) error
Broadcast sends the message over the wire to any receivers
func (*NetworkPubSub) NewSubscriberProps ¶
func (nps *NetworkPubSub) NewSubscriberProps(topic string) *actor.Props
func (*NetworkPubSub) RegisterTopicValidator ¶
func (nps *NetworkPubSub) RegisterTopicValidator(topic string, validatorFunc PubSubValidator, opts ...pubsub.ValidatorOpt) error
func (*NetworkPubSub) UnregisterTopicValidator ¶
func (nps *NetworkPubSub) UnregisterTopicValidator(topic string)
type PubSub ¶
type PubSub interface { Broadcast(topic string, msg proto.Message) error NewSubscriberProps(topic string) *actor.Props RegisterTopicValidator(topic string, validatorFunc PubSubValidator, opts ...pubsub.ValidatorOpt) error UnregisterTopicValidator(topic string) Subscribe(ctx spawner, topic string, subscribers ...*actor.PID) *actor.PID }
type SimulatedPubSub ¶
type SimulatedPubSub struct {
// contains filtered or unexported fields
}
SimulatedBroadcaster is a simulated in-memory pubsub that doesn't need a network connection
func NewSimulatedPubSub ¶
func NewSimulatedPubSub() *SimulatedPubSub
func (*SimulatedPubSub) Broadcast ¶
func (sb *SimulatedPubSub) Broadcast(topic string, message proto.Message) error
Implements the broadcast necessary for the client side to send to the network
func (*SimulatedPubSub) NewSubscriberProps ¶
func (sb *SimulatedPubSub) NewSubscriberProps(topic string) *actor.Props
returns subscriber props that can be used to listent to broadcast events
func (*SimulatedPubSub) RegisterTopicValidator ¶
func (sb *SimulatedPubSub) RegisterTopicValidator(topic string, validatorFunc PubSubValidator, opts ...pubsub.ValidatorOpt) error
func (*SimulatedPubSub) UnregisterTopicValidator ¶
func (sb *SimulatedPubSub) UnregisterTopicValidator(topic string)
type UnderlyingPubSub ¶
Click to show internal directories.
Click to hide internal directories.