Documentation
¶
Index ¶
Constants ¶
View Source
const ( // EPOLLIN - data available to read EPOLLIN int = unix.EPOLLIN // EPOLLOUT - writing is possible EPOLLOUT int = unix.EPOLLOUT // EPOLLET - Edge Triggered Event EPOLLET int = unix.EPOLLET // EPOLLPRI - Priority Event EPOLLPRI int = unix.EPOLLPRI // EPOLLHUP - fd was closed by the other side EPOLLHUP int = unix.EPOLLHUP // EPOLLONESHOT - fd is removed from the epoll set after first event is triggered EPOLLONESHOT int = unix.EPOLLONESHOT )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Epoll ¶
type Epoll struct {
// contains filtered or unexported fields
}
Epoll represents an epoll set
func Create ¶
Create creates new epoll set 0 threads => calling thread will take care of the event loop, no threads, no locks 1 thread => 1 thread is created to handle the event loop > 1 (N) threads => 1 thread is created to handle the event loop, N threads are
will be created to handle events in parallel (TODO)
func (*Epoll) Add ¶
func (me *Epoll) Add(obj *UserObject, events int)
Add new connection to the epoll set - net.TCPConn
func (*Epoll) Del ¶
func (me *Epoll) Del(obj *UserObject)
Del removes connection (net.TCPConn) from the epoll set
func (*Epoll) EventLoopNoThread ¶
func (me *Epoll) EventLoopNoThread()
EventLoopNoThread - event loop used directly by library user to handle events, no threads
type FuncAction ¶
type FuncAction int
FuncAction - value returned by event callback
const ( // CONTINUE - fd will remain in management OK FuncAction = 1 // STOP - fd should be removed from management EXIT FuncAction = 2 )
type UserObject ¶
type UserObject interface { GetFD() int GetFD0() int GetFD1() int Ptr() uintptr Close() Event(uo *UserObject, events uint32) FuncAction // same constants EPOLL*, ORed }
UserObject - Interface Objects from User must obey
Click to show internal directories.
Click to hide internal directories.