Version: v0.0.1 Latest Latest

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

Go to latest
Published: Mar 17, 2021 License: MIT Imports: 4 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type DelayQueue

type DelayQueue struct {
	// 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 New

func New(size int64) *DelayQueue

New creates an instance of delayQueue with the specified size.

func (*DelayQueue) Offer

func (dq *DelayQueue) Offer(value interface{}, expiration time.Time)

Offer inserts the element into the current queue.

func (*DelayQueue) Poll

func (dq *DelayQueue) Poll(noticC chan interface{})

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

func (*DelayQueue) Stop

func (dq *DelayQueue) Stop()

Stop poll

Source Files

Jump to

Keyboard shortcuts

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