Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrClientClosed = errors.New("handler client is closed")
)
Functions ¶
This section is empty.
Types ¶
type ConsumerOptions ¶
type ConsumerOptions struct { // PChannel is the pchannel of the consumer. PChannel string // VChannel is the vchannel of the consumer. VChannel string // DeliverPolicy is the deliver policy of the consumer. DeliverPolicy options.DeliverPolicy // DeliverFilters is the deliver filters of the consumer. DeliverFilters []options.DeliverFilter // Handler is the message handler used to handle message after recv from consumer. MessageHandler message.Handler }
ConsumerOptions is the options for creating a consumer.
type HandlerClient ¶
type HandlerClient interface { // CreateProducer creates a producer. // Producer is a stream client without keep alive promise. // It will be available until context canceled, active close, streaming error or remote server wal closing. // Because of there's no more ProducerOptions except PChannel, so a producer of same PChannel is shared by reference count. CreateProducer(ctx context.Context, opts *ProducerOptions) (Producer, error) // CreateConsumer creates a consumer. // Consumer is a stream client without keep alive promise. // It will be available until context canceled, active close, streaming error or remote server wal closing. // A consumer will not share stream connection with other consumers. CreateConsumer(ctx context.Context, opts *ConsumerOptions) (Consumer, error) // Close closes the handler client. // It will only stop the underlying service discovery, but don't stop the producer and consumer created by it. // So please close Producer and Consumer created by it before close the handler client. Close() }
HandlerClient is the interface that wraps streamingpb.StreamingNodeHandlerServiceClient. HandlerClient wraps the PChannel Assignment Service Discovery. Provides the ability to create pchannel-level producer and consumer.
func NewHandlerClient ¶
func NewHandlerClient(w types.AssignmentDiscoverWatcher) HandlerClient
NewHandlerClient creates a new handler client.
type ProducerOptions ¶
type ProducerOptions struct { // PChannel is the pchannel of the producer. PChannel string }
ProducerOptions is the options for creating a producer.
Click to show internal directories.
Click to hide internal directories.