Documentation ¶
Index ¶
- Constants
- func EpollCreate(flag int) (fd int, err error)
- func EpollCtl(epfd int, op int, fd int, event *epollevent) (err error)
- func EpollWait(epfd int, events []epollevent, msec int) (n int, err error)
- type IOEvent
- type PollEvent
- type Poller
- func (p *Poller) AddRead(fd int) error
- func (p *Poller) AddWrite(fd int) error
- func (p *Poller) Close() error
- func (p *Poller) Delete(fd int) error
- func (p *Poller) DeleteRead(fd int) error
- func (p *Poller) DeleteReadAndWrite(fd int) error
- func (p *Poller) DeleteWrite(fd int) error
- func (p *Poller) Polling(callback func(fd int, event PollEvent) error) error
Constants ¶
View Source
const ( // InitPollEventsCap represents the initial capacity of poller event-list. InitPollEventsCap = 128 // MaxPollEventsCap is the maximum limitation of events that the poller can process. MaxPollEventsCap = 1024 // MinPollEventsCap is the minimum limitation of events that the poller can process. MinPollEventsCap = 32 // MaxAsyncTasksAtOneTime is the maximum amount of asynchronous tasks that the event-loop will process at one time. MaxAsyncTasksAtOneTime = 256 // ErrEvents represents exceptional events that are not read/write, like socket being closed, // reading/writing from/to a closed socket, etc. ErrEvents = unix.EPOLLERR | unix.EPOLLHUP | unix.EPOLLRDHUP // OutEvents combines EPOLLOUT event and some exceptional events. OutEvents = ErrEvents | unix.EPOLLOUT // InEvents combines EPOLLIN/EPOLLPRI events and some exceptional events. InEvents = ErrEvents | unix.EPOLLIN | unix.EPOLLPRI )
View Source
const EPOLLET = -syscall.EPOLLET
Variables ¶
This section is empty.
Functions ¶
func EpollCreate ¶
EpollCreate implements epoll_create1.
Types ¶
type Poller ¶
func (*Poller) AddRead ¶
AddRead registers the given file-descriptor with readable event to the poller.
func (*Poller) DeleteRead ¶
DeleteRead deletes the given file-descriptor from the poller.
func (*Poller) DeleteReadAndWrite ¶
func (*Poller) DeleteWrite ¶
DeleteWrite deletes the given file-descriptor from the poller.
Click to show internal directories.
Click to hide internal directories.