container

package
v0.0.0-...-cb2ae7d Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DelayQueue

type DelayQueue struct {
	C chan interface{}
	// contains filtered or unexported fields
}

DelayQueue is an unbounded blocking queue of *Delayed* elements, in which an element can only be taken when its delay has expired. The head of the queue is the *Delayed* element whose delay expired furthest in the past.

func NewDelayQueue

func NewDelayQueue(size int) *DelayQueue

NewDelayQueue creates an instance of delayQueue with the specified size.

func (*DelayQueue) Offer

func (dq *DelayQueue) Offer(elem interface{}, expiration int64)

Offer inserts the element into the current queue.

func (*DelayQueue) Poll

func (dq *DelayQueue) Poll(exitC chan struct{}, nowF func() int64)

Poll starts an infinite loop, in which it continually waits for an element to expire and then send the expired element to the channel C.

type ThirdTuple

type ThirdTuple[T any] struct {
	First, Second, Third T
}

func NewThirdTuple

func NewThirdTuple[T any](first, second, third T) *ThirdTuple[T]

func (*ThirdTuple[T]) String

func (t *ThirdTuple[T]) String() string

type TwoTuple

type TwoTuple[T any] struct {
	First, Second T
}

func NewTwoTuple

func NewTwoTuple[T any](first, second T) *TwoTuple[T]

func (*TwoTuple[T]) String

func (t *TwoTuple[T]) String() string

Jump to

Keyboard shortcuts

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