Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAsyncProducer ¶
func NewAsyncProducer(c Config) (sarama.AsyncProducer, error)
NewAsyncProducer returns an asynchronous kafka producer using the sarama package.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service wraps a sarama.AsyncProducer to create a generators.Publisher that can be used with generators.Engine
func (*Service) Errors ¶
func (s *Service) Errors() <-chan *sarama.ProducerError
Errors is the error output channel back to the user. You MUST read from this channel or the Producer will deadlock when the channel is full. Alternatively, you can set Producer.Return.Errors in your config to false, which prevents errors to be returned.
func (*Service) Successes ¶
func (s *Service) Successes() <-chan *sarama.ProducerMessage
Successes is the success output channel back to the user when Return.Successes is enabled. If Return.Successes is true, you MUST read from this channel or the Producer will deadlock. It is suggested that you send and read messages together in a single select statement.