pub struct Poller { /* private fields */ }Expand description
A readiness poller and the thread that owns its armed set.
One per server. Poller::shutdown stops the thread; dropping the last
handle does the same.
Implementations§
Source§impl Poller
impl Poller
Sourcepub fn new(name: &str, priority: ThreadPriority) -> Result<Arc<Self>>
pub fn new(name: &str, priority: ThreadPriority) -> Result<Arc<Self>>
Start a poller and its thread.
name is the thread name, which is what an epicsThreadShowAll
equivalent prints; keep it short.
priority is the caller’s, not this module’s: the poll thread is the
reactor of whatever server owns it, and a server’s band is set against
the other servers in the IOC — pvxs runs its TCP reactor at
CAServerLow-2, CA’s rsrv its own ladder from caservertask.c. A
constant here would put every server’s reactor in one band and silently
undo that ordering.
Sourcepub fn stream(self: &Arc<Self>, stream: TcpStream) -> Result<ReadyStream>
pub fn stream(self: &Arc<Self>, stream: TcpStream) -> Result<ReadyStream>
Wrap an accepted socket so the protocol code can read and write it through this poller.
Sourcepub fn armed_fds(&self) -> usize
pub fn armed_fds(&self) -> usize
How many fds currently hold at least one armed interest. Test and report surface; not a control input.
An fd whose last waker has been taken but whose kernel registration is still queued for deletion is not one of them. The count is of tasks parked here, which is the question a report is asking.