Documentation ¶
Overview ¶
Package queue provides the implementation of buffer queue and interface of queue entry with Length method.
Index ¶
- type Entry
- type Queue
- func (q *Queue) Close()
- func (q *Queue) Dequeue() (e Entry, notify bool, err *tcpip.Error)
- func (q *Queue) Enqueue(e Entry) (notify bool, err *tcpip.Error)
- func (q *Queue) IsReadable() bool
- func (q *Queue) IsWritable() bool
- func (q *Queue) MaxQueueSize() int64
- func (q *Queue) Peek() (Entry, *tcpip.Error)
- func (q *Queue) QueuedSize() int64
- func (q *Queue) Reset()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Queue ¶
type Queue struct { ReaderQueue *waiter.Queue WriterQueue *waiter.Queue // contains filtered or unexported fields }
Queue is a buffer queue.
func (*Queue) Close ¶
func (q *Queue) Close()
Close closes q for reading and writing. It is immediately not writable and will become unreadble will no more data is pending.
Both the read and write queues must be notified after closing: q.ReaderQueue.Notify(waiter.EventIn) q.WriterQueue.Notify(waiter.EventOut)
func (*Queue) Dequeue ¶
Dequeue removes the first entry in the data queue, if one exists.
If notify is true, WriterQueue.Notify must be called: q.WriterQueue.Notify(waiter.EventOut)
func (*Queue) Enqueue ¶
Enqueue adds an entry to the data queue if room is available.
If notify is true, ReaderQueue.Notify must be called: q.ReaderQueue.Notify(waiter.EventIn)
func (*Queue) IsReadable ¶
IsReadable determines if q is currently readable.
func (*Queue) IsWritable ¶
IsWritable determines if q is currently writable.
func (*Queue) MaxQueueSize ¶
MaxQueueSize returns the maximum number of bytes storable in the queue.
func (*Queue) QueuedSize ¶
QueuedSize returns the number of bytes currently in the queue, that is, the number of readable bytes.