Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type In ¶
type In interface { // Messages returns channel that multiplexer receives messages from. Messages() <-chan *consumer.Message // Acks returns a channel that multiplexer sends a message that was pulled // from the `Messages()` channel of this input after the message has been // send to the output. Acks() chan<- *consumer.Message // Stop signals the input to stop and blocks waiting for its goroutines to // complete. Stop() }
In defines an interface of a multiplexer input.
type Int32Slice ¶
type Int32Slice []int32
func (Int32Slice) Len ¶
func (p Int32Slice) Len() int
func (Int32Slice) Less ¶
func (p Int32Slice) Less(i, j int) bool
func (Int32Slice) Swap ¶
func (p Int32Slice) Swap(i, j int)
type Out ¶
type Out interface { // Messages returns channel that multiplexer sends messages to. Messages() chan<- *consumer.Message }
Out defines an interface of multiplexer output.
type SpawnInF ¶
SpawnInF is a function type that is used by multiplexer to spawn inputs for assigned partitions during rewiring.
type T ¶
type T struct {
// contains filtered or unexported fields
}
T fetches messages from inputs and multiplexes them to the output, giving preferences to inputs with higher lag. Multiplexes assumes ownership over inputs in the sense that it decides when an new input instance needs to started, or the old one stopped.
func (*T) IsRunning ¶
IsRunning returns `true` if multiplexer is running pumping events from the inputs to the output.
func (*T) WireUp ¶
WireUp ensures that inputs of all assigned partitions are spawned and multiplexed to the specified output. It stops inputs for partitions that are no longer assigned, spawns inputs for newly assigned partitions, and restarts the multiplexer, if either output or any of inputs has changed.