Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Err ¶
Err is what is provided to the user when an error occurs. It wraps an error and includes the topic and partition.
type Errors ¶
type Errors []*Err
ConsumerErrors is a type that wraps a batch of errors and implements the Error interface. It can be returned from the PartitionConsumer's Close methods to avoid the need to manually drain errors when stopping.
type Factory ¶
type Factory interface {
// SpawnMessageStream creates a T instance for the given topic/partition
// with the given offset. It will return an error if there is an instance
// already consuming from the topic/partition.
//
// Offset can be a literal offset, or OffsetNewest or OffsetOldest. If
// offset is smaller then the oldest offset then the oldest offset is
// returned. If offset is larger then the newest offset then the newest
// offset is returned. If offset is either sarama.OffsetNewest or
// sarama.OffsetOldest constant, then the actual offset value is returned.
// otherwise offset is returned.
SpawnMessageStream(namespace *actor.ID, topic string, partition int32, offset int64) (T, int64, error)
// Stop shuts down the consumer. It must be called after all child partition
// consumers have already been closed.
Stop()
}
Factory provides API to spawn message streams to that read message from topic partitions. It ensures that there is only on message stream for a particular topic partition at a time.
type T ¶
type T interface {
// Messages returns the read channel for the messages that are fetched from
// the topic partition.
Messages() <-chan *consumer.Message
// Errors returns a read channel of errors that occurred during consuming,
// if enabled. By default, errors are logged and not returned over this
// channel. If you want to implement any custom error handling, set your
// config's Consumer.Return.Errors setting to true, and read from this
// channel.
Errors() <-chan *Err
// Stop synchronously stops the partition consumer. It must be called
// before the factory that created the instance can be stopped.
Stop()
}
T fetched messages from a given topic and partition.
Click to show internal directories.
Click to hide internal directories.