Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidMaxClients is returned when the maxClients is less than 0 ErrInvalidMaxClients = errors.New("invalid max clients") )
Functions ¶
This section is empty.
Types ¶
type Epoll ¶
type Epoll struct {
// contains filtered or unexported fields
}
Epoll implements the IOMultiplexer interface for Linux-based systems
type Event ¶
type Event struct { // Fd denotes the file descriptor Fd int // Op denotes the operations on file descriptor that are to be monitored Op Operations }
Event is a platform independent representation of a subscribe event For linux platform, this is translated to syscall.EpollEvent For darwin platform, this is translated to syscall.Kevent_t
type IOMultiplexer ¶
type IOMultiplexer interface { // Subscribe subscribes to the given event // When the event is triggered, the Poll method will return it Subscribe(event Event) error // Poll polls for all the subscribed events simultaneously // and returns all the events that were triggered // It blocks until at least one event is triggered or the timeout is reached Poll(timeout time.Duration) ([]Event, error) // Close closes the IOMultiplexer instance Close() error }
IOMultiplexer defines a generic interface for platform-specific I/O multiplexer implementations
type Operations ¶
type Operations uint32
Operations is a platform independent representation of the operations that need to be monitored on a file descriptor
const ( // OP_READ represents the read operation OP_READ Operations = 1 << iota // OP_WRITE represents the write operation OP_WRITE )
Click to show internal directories.
Click to hide internal directories.