producer

package
v0.10.3-0...-92e6ee6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL