redis

package
v0.0.0-...-04375c8 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NONE     Action = 0
	READABLE        = 1
	WRITABLE        = 2
	BARRIER         = 4
)
View Source
const (
	NOMORE           = -1
	DELETED_EVENT_ID = -1
)

Variables

View Source
var (
	OK  = errors.New("OK")
	ERR = errors.New("ERR")
)

Functions

func GetTime

func GetTime() time.Time

Types

type Action

type Action int8

func Wait

func Wait(fd int, mask int, milliseconds int) (Action, error)

type BeforeSleepProc

type BeforeSleepProc func(eventLoop *EventLoop)

type Event

type Event int8
const (
	FILE_EVENTS Event = 1 << iota
	TIME_EVENTS
	DONT_WAIT
	CALL_BEFORE_SLEEP
	CALL_AFTER_SLEEP
	ALL_EVENTS = (FILE_EVENTS | TIME_EVENTS)
)

type EventFinalizerProc

type EventFinalizerProc func(eventLoop *EventLoop, clientData interface{})

type EventLoop

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

func Create

func Create(setSize int) *EventLoop

初始化函数

func (*EventLoop) CreateFileEvent

func (el *EventLoop) CreateFileEvent(fd int, mask Action, proc FileProc, clientData interface{}) error

func (*EventLoop) CreateTimeEvent

func (el *EventLoop) CreateTimeEvent(milliseconds time.Duration, proc TimeProc, clientData interface{}, finalizerProc EventFinalizerProc)

func (*EventLoop) Delete

func (el *EventLoop) Delete()

func (*EventLoop) DeleteFileEvent

func (el *EventLoop) DeleteFileEvent(fd int, mask Action)

func (*EventLoop) DeleteTimeEvent

func (el *EventLoop) DeleteTimeEvent(id int) error

func (*EventLoop) GetApiName

func (el *EventLoop) GetApiName() string

func (*EventLoop) GetFileEvents

func (el *EventLoop) GetFileEvents(fd int) Action

func (*EventLoop) GetSetSize

func (el *EventLoop) GetSetSize() int

func (*EventLoop) Main

func (el *EventLoop) Main()

func (*EventLoop) ProcessEvents

func (el *EventLoop) ProcessEvents(flags Event) int

func (*EventLoop) ProcessTimeEvents

func (el *EventLoop) ProcessTimeEvents() int

func (*EventLoop) Resize

func (el *EventLoop) Resize(setSize int) error

func (*EventLoop) SetAfterSleepProc

func (el *EventLoop) SetAfterSleepProc(afterSleep BeforeSleepProc)

func (*EventLoop) SetBeforeSleepProc

func (el *EventLoop) SetBeforeSleepProc(beforeSleep BeforeSleepProc)

func (*EventLoop) SetDontWait

func (el *EventLoop) SetDontWait(noWait bool)

func (*EventLoop) Stop

func (el *EventLoop) Stop()

type FileEvent

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

type FileProc

type FileProc func(eventLoop *EventLoop, fd int, clientData interface{}, mask int)

type FiredEvent

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

type IDType

type IDType int8

type TimeEvent

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

type TimeProc

type TimeProc func(eventLoop *EventLoop, id int, clientData interface{}) (time.Time, IDType)

Jump to

Keyboard shortcuts

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