eventloop

package
v0.0.0-...-a5d5012 Latest Latest
Warning

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

Go to latest
Published: May 22, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delay

func Delay(z int)

func DurationToMill

func DurationToMill(d time.Duration) int64

Types

type AntsLogger

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

func (*AntsLogger) Printf

func (this_ *AntsLogger) Printf(format string, args ...interface{})

type EsQueue

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

EsQueue lock free queue

func NewQueue

func NewQueue(capacity uint32) *EsQueue

func (*EsQueue) Capaciity

func (q *EsQueue) Capaciity() uint32

func (*EsQueue) Get

func (q *EsQueue) Get() (val interface{}, ok bool, quantity uint32)

Get get queue functions

func (*EsQueue) Gets

func (q *EsQueue) Gets(values []interface{}) (gets, quantity uint32)

Gets gets queue functions

func (*EsQueue) Put

func (q *EsQueue) Put(val interface{}) (ok bool, quantity uint32)

put queue functions

func (*EsQueue) Puts

func (q *EsQueue) Puts(values []interface{}) (puts, quantity uint32)

Puts puts queue functions

func (*EsQueue) Quantity

func (q *EsQueue) Quantity() uint32

func (*EsQueue) String

func (q *EsQueue) String() string

type EventLoop

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

func NewEventLoop

func NewEventLoop(log *logger.Logger) *EventLoop

func (*EventLoop) AfterFuncPool

func (this_ *EventLoop) AfterFuncPool(d time.Duration, f func())

func (*EventLoop) AfterFuncQueue

func (this_ *EventLoop) AfterFuncQueue(d time.Duration, f func())

func (*EventLoop) PostEventQueue

func (this_ *EventLoop) PostEventQueue(e interface{})

func (*EventLoop) PostFuncQueue

func (this_ *EventLoop) PostFuncQueue(f func())

func (*EventLoop) Start

func (this_ *EventLoop) Start(f func(event interface{}), endF ...func())

func (*EventLoop) Stop

func (this_ *EventLoop) Stop()

func (*EventLoop) Stopped

func (this_ *EventLoop) Stopped() bool

func (*EventLoop) TickPool

func (this_ *EventLoop) TickPool(d time.Duration, f func() bool)

func (*EventLoop) TickQueue

func (this_ *EventLoop) TickQueue(d time.Duration, f func() bool)

func (*EventLoop) UntilFuncPool

func (this_ *EventLoop) UntilFuncPool(t time.Time, f func())

func (*EventLoop) UntilFuncQueue

func (this_ *EventLoop) UntilFuncQueue(t time.Time, f func())

type Ticker

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

func NewTicker

func NewTicker(log *logger.Logger) *Ticker

func (*Ticker) AfterFunc

func (this_ *Ticker) AfterFunc(d time.Duration, f func())

func (*Ticker) AfterFuncPool

func (this_ *Ticker) AfterFuncPool(d time.Duration, f func())

func (*Ticker) AfterFuncQueue

func (this_ *Ticker) AfterFuncQueue(d time.Duration, f func())

func (*Ticker) GetPool

func (this_ *Ticker) GetPool() *ants.Pool

func (*Ticker) GetQueue

func (this_ *Ticker) GetQueue() *EsQueue

func (*Ticker) Stop

func (this_ *Ticker) Stop()

func (*Ticker) Tick

func (this_ *Ticker) Tick(d time.Duration, fb func() bool)

func (*Ticker) TickPool

func (this_ *Ticker) TickPool(d time.Duration, fb func() bool)

func (*Ticker) TickQueue

func (this_ *Ticker) TickQueue(d time.Duration, fb func() bool)

Jump to

Keyboard shortcuts

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