Documentation ¶
Overview ¶
Poller provides an encapsulation of methods provided by package sys which is a generalization of syscalls from different platforms.
Index ¶
- Variables
- func PutTask(t *PollTask)
- type PollTask
- type Poller
- func (that *Poller) AddPriorTask(f iface.PollTaskFunc, arg iface.PollTaskArg) (err error)
- func (that *Poller) AddRead(fd iface.IFd) error
- func (that *Poller) AddReadWrite(fd iface.IFd) error
- func (that *Poller) AddTask(f iface.PollTaskFunc, arg iface.PollTaskArg) (err error)
- func (that *Poller) AddWrite(fd iface.IFd) error
- func (that *Poller) Close() error
- func (that *Poller) GetFd() int
- func (that *Poller) GetPollEvFd() int
- func (that *Poller) ModRead(fd iface.IFd) error
- func (that *Poller) ModReadWrite(fd iface.IFd) error
- func (that *Poller) ModWrite(fd iface.IFd) error
- func (that *Poller) RemoveFd(fd iface.IFd) error
- func (that *Poller) Start(callback iface.IPollCallback) error
Constants ¶
This section is empty.
Variables ¶
View Source
var PollTaskPool = sync.Pool{ New: func() interface{} { return &PollTask{} }, }
Functions ¶
Types ¶
type PollTask ¶
type PollTask struct { Go iface.PollTaskFunc Arg iface.PollTaskArg }
type Poller ¶
type Poller struct { Eloop iface.IELoop // eventloop Pool *ants.Pool // goroutine pool for running tasks ErrForStop chan error // channel for sending error info to stop the whole engine ReadBufferSize int // size of read buffer when reading from fd // contains filtered or unexported fields }
func (*Poller) AddPriorTask ¶
func (that *Poller) AddPriorTask(f iface.PollTaskFunc, arg iface.PollTaskArg) (err error)
func (*Poller) AddTask ¶
func (that *Poller) AddTask(f iface.PollTaskFunc, arg iface.PollTaskArg) (err error)
func (*Poller) GetPollEvFd ¶
Click to show internal directories.
Click to hide internal directories.