circuits.core.pollers module

Poller Components for asynchronous file and socket I/O.

This module contains Poller components that enable polling of file or socket descriptors for read/write events. Pollers: - Select - Poll - EPoll

class circuits.core.pollers.BasePoller(channel=None)

Bases: circuits.core.components.BaseComponent

addReader(source, fd)
addWriter(source, fd)
channel = None
discard(fd)
getTarget(fd)
isReading(fd)
isWriting(fd)
removeReader(fd)
removeWriter(fd)
resume()
circuits.core.pollers.Poller

alias of Select

class circuits.core.pollers.Select(...) → new Select Poller Component

Bases: circuits.core.pollers.BasePoller

Creates a new Select Poller Component that uses the select poller implementation. This poller is not recommended but is available for legacy reasons as most systems implement select-based polling for backwards compatibility.

channel = 'select'
class circuits.core.pollers.Poll(...) → new Poll Poller Component

Bases: circuits.core.pollers.BasePoller

Creates a new Poll Poller Component that uses the poll poller implementation.

addReader(source, fd)
addWriter(source, fd)
channel = 'poll'
discard(fd)
removeReader(fd)
removeWriter(fd)
class circuits.core.pollers.EPoll(...) → new EPoll Poller Component

Bases: circuits.core.pollers.BasePoller

Creates a new EPoll Poller Component that uses the epoll poller implementation.

addReader(source, fd)
addWriter(source, fd)
channel = 'epoll'
discard(fd)
removeReader(fd)
removeWriter(fd)
class circuits.core.pollers.KQueue(...) → new KQueue Poller Component

Bases: circuits.core.pollers.BasePoller

Creates a new KQueue Poller Component that uses the kqueue poller implementation.

addReader(source, sock)
addWriter(source, sock)
channel = 'kqueue'
discard(sock)
removeReader(sock)
removeWriter(sock)