Documentation
¶
Index ¶
- func GetUnixTime() int64
- type EventLoop
- func (loop *EventLoop) AddEvent(fd int, eventType FileEventType, fn FileProcFn, extra interface{}) (err error)
- func (loop *EventLoop) AddTimeEvent(interval int64, eventType TimeEventType, fn TimeProcFn, extra interface{})
- func (loop *EventLoop) AeMain() error
- func (loop *EventLoop) DelEvent(fd int, eventType FileEventType) (err error)
- func (loop *EventLoop) DelTimeEvent(id int)
- func (loop *EventLoop) Range() (n int)
- func (loop *EventLoop) Wait() ([]*FileEvent, []*TimeEvent, error)
- type FileEvent
- type FileEventType
- type FileProcFn
- type TimeEvent
- type TimeEventType
- type TimeProcFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EventLoop ¶
type EventLoop struct {
// contains filtered or unexported fields
}
func CreateEventLoop ¶
func (*EventLoop) AddEvent ¶
func (loop *EventLoop) AddEvent(fd int, eventType FileEventType, fn FileProcFn, extra interface{}) (err error)
func (*EventLoop) AddTimeEvent ¶
func (loop *EventLoop) AddTimeEvent(interval int64, eventType TimeEventType, fn TimeProcFn, extra interface{})
func (*EventLoop) DelEvent ¶
func (loop *EventLoop) DelEvent(fd int, eventType FileEventType) (err error)
func (*EventLoop) DelTimeEvent ¶
type FileEventType ¶
type FileEventType int
const ( FileEventType_Readable FileEventType = 1 // 可读 FileEventType_Writeable FileEventType = 2 // 可写 )
type FileProcFn ¶
type FileProcFn func(extra interface{}) // 文件处理回调
type TimeEventType ¶
type TimeEventType int
const ( TimeEventType_Cycle TimeEventType = 1 // 循环 TimeEventType_Once TimeEventType = 2 // 一次性 )
type TimeProcFn ¶
type TimeProcFn func(extra interface{}) // 时间处理回调
Click to show internal directories.
Click to hide internal directories.