Documentation ¶
Overview ¶
Package poll impl io multiplexing on different systems.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var PollerManager *pollerManager
Functions ¶
This section is empty.
Types ¶
type Epoll ¶
type Epoll struct {
// contains filtered or unexported fields
}
Epoll poller for epoll.
type NetFileDesc ¶
type NetFileDesc struct { // FD system fd FD int // listener for poller NetPollListener }
NetFileDesc file-desc for net-fd
type NetPollListener ¶
type NetPollListener struct { // OnRead will run where fd is readable OnRead // OnWrite will run where fd is writeable OnWrite // OnInterrupt will run where fd is interrupted OnInterrupt }
NetPollListener listener for net poller
type OnInterrupt ¶
type OnInterrupt func() error
OnInterrupt The callback function when the net fd state is interrupt
type OnRead ¶
type OnRead func() error
OnRead the callback function when the net fd state is readable
type OnWrite ¶
type OnWrite func() error
OnWrite The callback function when the net fd state is writable
type Poll ¶
type Poll interface { // Register netFd in the poller. events is the type of event that the poller focus on Register(netFd *NetFileDesc, eventType EventType) error // Wait // poller will focus on all registered netFd, wait for netFd to satisfy the condition and // notify the registered listener, so it is blocked Wait() error // Close the poller Close() error }
Poll define net poll interface.
Click to show internal directories.
Click to hide internal directories.