Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProduceResult ¶
type ProduceResult = types.AppendResult
type Producer ¶
type Producer interface { // Assignment returns the assignment of the producer. Assignment() types.PChannelInfoAssigned // Produce sends the produce message to server. // TODO: Support Batch produce here. Produce(ctx context.Context, msg message.MutableMessage) (*ProduceResult, error) // Check if a producer is available. IsAvailable() bool // Available returns a channel that will be closed when the producer is unavailable. Available() <-chan struct{} // Close close the producer client. Close() }
Producer is the interface that wraps the basic produce method on grpc stream. Producer is work on a single stream on grpc, so Producer cannot recover from failure because of the stream is broken.
func CreateProducer ¶
func CreateProducer( ctx context.Context, opts *ProducerOptions, handler streamingpb.StreamingNodeHandlerServiceClient, ) (Producer, error)
CreateProducer create a new producer client.
type ProducerOptions ¶
type ProducerOptions struct { // The produce target Assignment *types.PChannelInfoAssigned }
ProducerOptions is the options for creating a producer.
Click to show internal directories.
Click to hide internal directories.