Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Consumer ¶
type Consumer interface { // Run will get the messages and pass to the runner. Run() // Kill will try to stop the internal work. Return an error in case of failure. Kill() error // Alive returns true if the tomb is not in a dying or dead state. Alive() bool // Name return the consumer name Name() string // FactoryName is the name of the factory responsible for this consumer. FactoryName() string }
Consumer consume messages and pass to workers who will process the messages.
type Factory ¶
type Factory interface { // CreateConsumers will iterate over config and create all the consumers CreateConsumers() ([]Consumer, error) // CreateConsumer create a new consumer for a specific name using the config provided. CreateConsumer(name string) (Consumer, error) // Name return the factory name Name() string }
Factory create consumers
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is the block responsible for creating all the consumers. Keeping track of the current state of consumers and stop/restart consumers when needed.
func NewManager ¶
NewManager init a new manager and wait for operations.
type MultiError ¶
type MultiError []error
MultiError is returned by batch operations when there are errors with particular elements. Errors will be in a one-to-one correspondence with the input elements; successful elements will have a nil entry.
func (MultiError) Error ¶
func (m MultiError) Error() string
Click to show internal directories.
Click to hide internal directories.