streamqueue

package
v0.61.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Element

type Element struct {
	// Stanza contains the element stanza.
	Stanza stravaganza.Stanza

	// H contains the incremental h value associated to the element stanza.
	H uint32
}

Element defines a stream queue element type.

type Queue

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

Queue represents and c2s resumable queue.

func New

func New(
	stm stream.C2S,
	nonce []byte,
	elements []Element,
	inH uint32,
	outH uint32,
	requestAckInterval time.Duration,
	waitForAckTimeout time.Duration,
) *Queue

New creates and initializes a new Queue instance.

func (*Queue) Acknowledge

func (q *Queue) Acknowledge(h uint32)

Acknowledge process and acknowledge a h value.

func (*Queue) CancelTimers

func (q *Queue) CancelTimers()

CancelTimers cancels all queue internal timers.

func (*Queue) Elements

func (q *Queue) Elements() []Element

Elements returns queue pending to send elements.

func (*Queue) GetStream

func (q *Queue) GetStream() stream.C2S

GetStream returns queue internal stream.

func (*Queue) HandleIn

func (q *Queue) HandleIn()

HandleIn process and incoming queue stanza.

func (*Queue) HandleOut

func (q *Queue) HandleOut(stanza stravaganza.Stanza)

HandleOut process and outgoing queue stanza.

func (*Queue) InboundH

func (q *Queue) InboundH() uint32

InboundH returns incoming h value.

func (*Queue) Len

func (q *Queue) Len() int

Len returns current queue length.

func (*Queue) Nonce

func (q *Queue) Nonce() []byte

Nonce returns the queue nonce byte slice.

func (*Queue) OutboundH

func (q *Queue) OutboundH() uint32

OutboundH returns outgoing h value.

func (*Queue) RequestAck

func (q *Queue) RequestAck()

RequestAck sends an r stanza to the queue internal stream.

func (*Queue) ScheduleR

func (q *Queue) ScheduleR()

ScheduleR schedules and r stanza sending.

func (*Queue) SendPending

func (q *Queue) SendPending()

SendPending sends all pending stanzas to the queue internal stream.

func (*Queue) SetStream

func (q *Queue) SetStream(stm stream.C2S)

SetStream sets queue internal stream.

type QueueMap

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

QueueMap defines a map of stream stanza queues.

func NewQueueMap

func NewQueueMap() *QueueMap

NewQueueMap creates and initializes a new QueueMap instance.

func (*QueueMap) Delete

func (qm *QueueMap) Delete(k string) *Queue

Delete deletes the Queue value associated to k key.

func (*QueueMap) Get

func (qm *QueueMap) Get(key string) *Queue

Get returns Queue associated to k key.

func (*QueueMap) Set

func (qm *QueueMap) Set(k string, q *Queue)

Set associates a Queue value to k key.

Jump to

Keyboard shortcuts

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