Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultZMQHWM configures the high water mark for the push socket. // More info: http://api.zeromq.org/4-1:zmq-setsockopt#toc39 DefaultZMQHWM = 4000 // DefaultNumIdleConns configures the number of idle sockets to maintain for zmq. DefaultNumIdleConns = 10 )
Variables ¶
View Source
var ErrClientClosed = errors.New("Client Closed")
ErrClientClosed indicates that the client has been closed and is not longer usable.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // Put sends `data` to a given partition of a stream asynchronously. Put(ctx context.Context, stream, partition string, data map[string]interface{}) error // Close flushes all in-flight `Put`s and blocks new `Put`s, effectively closing the client. Close(ctx context.Context) error }
Client defines the interface of a tritond client.
func NewNoopClient ¶
func NewNoopClient() Client
NewNoopClient creates a `Client` that performs no operation and allways returns successfully.
type MockClient ¶
type MockClient struct { StreamData map[string]([](map[string]interface{})) PartitionCount map[string]int WriteSignal chan bool // contains filtered or unexported fields }
MockClient implements a client that stores the messages in memory
func (*MockClient) Close ¶
func (c *MockClient) Close(ctx context.Context) error
Close is a noop for a mock client. Meets `Client` inteface
func (*MockClient) Put ¶
func (c *MockClient) Put(ctx context.Context, stream, partition string, data map[string]interface{}) error
Put implements the client interface
func (*MockClient) Reset ¶
func (c *MockClient) Reset()
Reset resets MockClient to the initial state
type Option ¶
type Option func(c *zeromqClient) error
Option defines a function that can be used to configure a client
func WithNumIdleConns ¶
WithNumIdleConns sets the maximum number of idle zmq sockets
func WithZMQEndpoint ¶
WithZMQEndpoint sets the endpoint for zeromq
Click to show internal directories.
Click to hide internal directories.