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.
Click to show internal directories.
Click to hide internal directories.