Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandOption ¶
type CommandOption interface {
Option
// contains filtered or unexported methods
}
func WithAck ¶
func WithAck(b bool) CommandOption
WithAck specifies if the command method such as Subscribe() should block to wait for an ack from the Service
type Loopback ¶
type Loopback struct {
// contains filtered or unexported fields
}
Loopback is used for in-memory broadcasting and debugging. Whatever you send to it, it loops back to the pubsub.Service
func NewLoopback ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is responsible for accepting a payload, and pubsubing it to all data sinks. It is expected that the data sinks do not block more than absolutely necessary
func (*Service) Receive ¶
func (svc *Service) Receive(v interface{}, options ...CommandOption) error
Receive should only be used by whatever ingress service. When there is new data coming in from the ingress, this method can be used to pubsub the data to the subscribers
func (*Service) Subscribe ¶
func (svc *Service) Subscribe(s Subscriber, options ...CommandOption) error
Subscribe registers a subscriber to receive pubsub messages
func (*Service) Unsubscribe ¶
func (svc *Service) Unsubscribe(s Subscriber, options ...CommandOption) error
Unsubscribe unregisters a previously registered subscriber
type SubscribeFunc ¶
type SubscribeFunc func(interface{}) error
func (SubscribeFunc) Equal ¶
func (s SubscribeFunc) Equal(another Subscriber) bool
func (SubscribeFunc) Receive ¶
func (s SubscribeFunc) Receive(v interface{}) error
type Subscriber ¶
type Subscriber interface {
Receive(interface{}) error
}