Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClosablePool ¶
type ClosablePool struct {
// contains filtered or unexported fields
}
ClosablePool - Keeps a reference to a pool of closable types and closes them in tiers.
func NewClosablePool ¶
func NewClosablePool() *ClosablePool
NewClosablePool - Create a fresh pool of closable types.
func (*ClosablePool) Add ¶
func (c *ClosablePool) Add(tier int, closable types.Closable)
Add - Adds a closable type to the pool, tiers are used to partition and order the closing of types (starting at the lowest tier and working upwards). Closable types in a single tier are closed in the order that they are added.
func (*ClosablePool) Close ¶
func (c *ClosablePool) Close(timeout time.Duration) error
Close - Attempt to close and clean up all stored closables in the determined order. If the timeout is met whilst working through the pool there is no indication of how far the pool has been progressed, thus this timeout should only be used for preventing severe blocking of a service.
type MockInputType ¶
MockInputType - Implements the input.Type interface.
func (*MockInputType) MessageChan ¶
func (m *MockInputType) MessageChan() <-chan types.Message
MessageChan - Returns the messages channel.
func (*MockInputType) StartListening ¶
func (m *MockInputType) StartListening(resChan <-chan types.Response) error
StartListening - Sets the channel used for reading responses.
func (MockInputType) WaitForClose ¶
func (m MockInputType) WaitForClose(time.Duration) error
WaitForClose - Does nothing.
type MockOutputType ¶
MockOutputType - Implements the output.Type interface.
func (*MockOutputType) ResponseChan ¶
func (m *MockOutputType) ResponseChan() <-chan types.Response
ResponseChan - Returns the errors channel.
func (*MockOutputType) StartReceiving ¶
func (m *MockOutputType) StartReceiving(msgs <-chan types.Message) error
StartReceiving - Sets the read channel. This implementation is NOT thread safe.
func (MockOutputType) WaitForClose ¶
func (m MockOutputType) WaitForClose(time.Duration) error
WaitForClose - Does nothing.