client

package
v0.0.0-...-1bf0eed Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBatchWindow = 150 * time.Microsecond
	BatchingEnabled    = true
)
View Source
const StreamOpenDelay = 10 // ms

Variables

This section is empty.

Functions

func GetRequest

func GetRequest() *gen.Request

GetRequest obtains a pooled protobuf Request.

func GetResponse

func GetResponse() *gen.Response

GetResponse obtains a pooled protobuf Response.

func IsTimeoutErr

func IsTimeoutErr(err error) bool

IsTimeoutErr checks whether the given error is a QUIC idle timeout error.

func ReleaseRequest

func ReleaseRequest(req *gen.Request)

ReleaseRequest returns a protobuf Request to the pool.

func ReleaseResponse

func ReleaseResponse(resp *gen.Response)

ReleaseResponse returns a protobuf Response to the pool.

Types

type Batcher

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

Batcher coalesces small writes into larger ones with a configurable flush window to reduce syscall overhead. When BatchingEnabled is true, the first write goes through immediately and subsequent writes are buffered until Flush is called.

func NewBatcher

func NewBatcher(s *quic.Stream) *Batcher

NewBatcher creates a new Batcher for the given stream.

func (*Batcher) Flush

func (b *Batcher) Flush() error

func (*Batcher) Flushed

func (b *Batcher) Flushed() bool

func (*Batcher) Write

func (b *Batcher) Write(data []byte) error

type Multiplexer

type Multiplexer interface {
	GetStream() (*quic.Stream, error)
	Close()
}

Multiplexer manages a pool of pre-opened QUIC streams over a single connection and dispatches incoming frames via the sharded map.

func NewMultiplexer

func NewMultiplexer(
	conn *quic.Conn,
	quicbalancer qrpc_quic.Balancer,
	streamsCount uint16,
	chansMap *internal.ShardedMap,
) Multiplexer

NewMultiplexer creates a new Multiplexer, opens streamsCount QUIC streams, and starts read-cycle goroutines for each stream.

type MultiplexerImpl

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

MultiplexerImpl is the concrete implementation of Multiplexer. It opens streamsCount pre-created QUIC streams and runs read-cycle goroutines.

func (*MultiplexerImpl) Close

func (m *MultiplexerImpl) Close()

func (*MultiplexerImpl) GetBatcher

func (m *MultiplexerImpl) GetBatcher(s *quic.Stream) *Batcher

func (*MultiplexerImpl) GetStream

func (m *MultiplexerImpl) GetStream() (*quic.Stream, error)

Jump to

Keyboard shortcuts

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