mux

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: Apache-2.0 Imports: 6 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ShardSize int

DOC: * ShardQueue uses the netpoll's nocopy API to merge and send data. * The Data Flush is passively triggered by ShardQueue.Add and does not require user operations. * If there is an error in the data transmission, the connection will be closed. * * ShardQueue.Add: add the data to be sent. * NewShardQueue: create a queue with netpoll.Connection. * ShardSize: the recommended number of shards is 32.

Functions

This section is empty.

Types

type ShardQueue

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

ShardQueue uses the netpoll's nocopy API to merge and send data. The Data Flush is passively triggered by ShardQueue.Add and does not require user operations. If there is an error in the data transmission, the connection will be closed. ShardQueue.Add: add the data to be sent.

func NewShardQueue

func NewShardQueue(size int, conn netpoll.Connection) (queue *ShardQueue)

NewShardQueue .

func (*ShardQueue) Add

func (q *ShardQueue) Add(gts ...WriterGetter)

Add adds to q.getters[shard]

func (*ShardQueue) Close added in v0.3.2

func (q *ShardQueue) Close() error

type WriterGetter

type WriterGetter func() (buf netpoll.Writer, isNil bool)

WriterGetter is used to get a netpoll.Writer.

Jump to

Keyboard shortcuts

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