Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MessageHandler ¶
MessageHandler takes a message from Producer when the returned value `exit` is true, the producer needs to stop producing and exit current loop
type Producer ¶
type Producer interface { // Start is a non-blocking call. It starts internal goroutine/s that produce messages. Start() error // Shutdown stops the producer and cleans up its resources. Should wait for all internal goroutines to exit. Shutdown() }
type ProducerFactory ¶
type ProducerFactory func(handler MessageHandler, topic string) Producer
ProducerFactory creates Producer instances for the desired topic the handler func is stored in the Producer, to be called when a message is produced
type Subscriber ¶
type Subscriber struct {
// contains filtered or unexported fields
}
func NewSubscriber ¶
func NewSubscriber(producerFactory ProducerFactory) *Subscriber
func (*Subscriber) Close ¶
func (s *Subscriber) Close() error
Click to show internal directories.
Click to hide internal directories.