interceptor

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type QueueInterceptor

type QueueInterceptor struct {
	// contains filtered or unexported fields
}

QueueInterceptor is a gRPC client interceptor that queues requests and processes them one by one.

func NewQueueInterceptor

func NewQueueInterceptor(queueSize int) *QueueInterceptor

NewQueueInterceptor creates a new QueueInterceptor with a given queue size.

func (*QueueInterceptor) StreamInterceptor

func (qi *QueueInterceptor) StreamInterceptor(
	ctx context.Context,
	desc *grpc.StreamDesc,
	cc *grpc.ClientConn,
	method string,
	streamer grpc.Streamer,
	opts ...grpc.CallOption,
) (grpc.ClientStream, error)

StreamInterceptor is a stream client interceptor implementation that serializes requests and enforces queue limits. It ensures only one stream is processed at a time and respects context cancellation.

func (*QueueInterceptor) UnaryInterceptor

func (qi *QueueInterceptor) UnaryInterceptor(
	ctx context.Context,
	method string,
	req, reply interface{},
	cc *grpc.ClientConn,
	invoker grpc.UnaryInvoker,
	opts ...grpc.CallOption,
) error

UnaryInterceptor is a unary client interceptor implementation that serializes requests and enforces queue limits. It ensures only one request is processed at a time and respects context cancellation.

Jump to

Keyboard shortcuts

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