internal

package
v0.0.0-...-751f591 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRead

func AddRead(p, fd int, readon, writeon *bool) error

func AddWrite

func AddWrite(p, fd int, readon, writeon *bool) error

func DelRead

func DelRead(p, fd int, readon, writeon *bool) error

func DelWrite

func DelWrite(p, fd int, readon, writeon *bool) error

func GetFD

func GetFD(evs interface{}, i int) int

func MakeEvents

func MakeEvents(n int) interface{}

func MakePoll

func MakePoll() (p int, err error)

func SetKeepAlive

func SetKeepAlive(fd, secs int) error

func Wait

func Wait(p int, evs interface{}, timeout time.Duration) (n int, err error)

Types

type TimeoutQueue

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

TimeoutQueue is a priority queue ordere be ascending time.Time.

func NewTimeoutQueue

func NewTimeoutQueue() *TimeoutQueue

NewTimeoutQueue returns a new TimeoutQueue.

func (*TimeoutQueue) Len

func (q *TimeoutQueue) Len() int

Len returns the number of items in the queue

func (*TimeoutQueue) Peek

func (q *TimeoutQueue) Peek() TimeoutQueueItem

Peek returns the items with the smallest value, but does not remove it.

func (*TimeoutQueue) Pop

func (q *TimeoutQueue) Pop() TimeoutQueueItem

Pop removes and returns the items with the smallest value.

func (*TimeoutQueue) Push

func (q *TimeoutQueue) Push(x TimeoutQueueItem)

Push adds a new item.

type TimeoutQueueItem

type TimeoutQueueItem interface {
	Timeout() time.Time
}

TimeoutQueueItem is an item for TimeoutQueue

Jump to

Keyboard shortcuts

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