Documentation
¶
Overview ¶
Package consumer contains the Consumer protocol handler. It sets up a client which is handling the data coming through a ReadWriteCloser given from the Connector function.
Example:
var wg sync.WaitGroup consumer, err := Make(func() (io.ReadWriteCloser, error) { return net.Dial("tcp","127.0.0.1:2000") }, channels, terminate, logger) if err != nil { panic(fmt.Sprintf("Could not create consumer: %v", err.Error())) } consumer.Run(&wg)
Index ¶
Constants ¶
This section is empty.
Variables ¶
ErrTerminated is returned when the client stops due to it being stopped through the terminated channel
Functions ¶
Types ¶
type Connector ¶
type Connector func() (io.ReadWriteCloser, error)
Connector is a function signature that is called when a new consumer connection should be attempted.
Click to show internal directories.
Click to hide internal directories.