dfx 0.1.0
Linux-based dynamic dataflow executor
Loading...
Searching...
No Matches
dfx::Runtime::Api::PollerProxy Class Reference

Node-scoped proxy implementation of FdWatch::Poller. More...

#include <dfx-runtime-api/PollerProxy.hpp>

Inheritance diagram for dfx::Runtime::Api::PollerProxy:
[legend]
Collaboration diagram for dfx::Runtime::Api::PollerProxy:
[legend]

Public Member Functions

 PollerProxy (Core::NodeWPtr node, NodeReactor &reactor)
 Construct a poller proxy bound to a given node.
void registerFd (FdWatch::BorrowedFd fd, FdWatch::EventInterests events, FdWatch::FdCallback cb) override
 Register a file descriptor for event notifications.
void deregisterFd (FdWatch::BorrowedFd fd) noexcept override
 Deregister a previously registered file descriptor.
void deferCall (FdWatch::Callback cb) override
 Schedule a callback to run later in the reactor context.
Public Member Functions inherited from dfx::FdWatch::Poller
virtual ~Poller ()=default
 Virtual destructor for interface.
virtual void registerFd (BorrowedFd fd, EventInterests events, FdCallback cb)=0
 Registers a file descriptor with the poller.

Detailed Description

Node-scoped proxy implementation of FdWatch::Poller.

This class adapts the generic FdWatch::Poller interface to the runtime's node-centric reactor model.

The proxy does not own any resources itself; it simply forwards:

The forwarding is performed while attaching the node identity (a Core::NodeWPtr), allowing the reactor to:

  • attribute watched FDs and callbacks to the correct node
  • apply node-specific lifetime rules / cleanup policies
  • keep the public node API free of direct reactor dependencies

A proxy is used to implement the dfx::Core::Node::poller() function and can be used by any node.

Note
The referenced NodeReactor must outlive this proxy instance. The node is stored as a weak pointer; if it expires, behavior depends on the reactor implementation (typically: ignore, reject, or clean up safely).
Thread-safety is defined by the underlying NodeReactor implementation. This proxy adds no additional synchronization.

Constructor & Destructor Documentation

◆ PollerProxy()

dfx::Runtime::Api::PollerProxy::PollerProxy ( Core::NodeWPtr node,
NodeReactor & reactor )
inline

Construct a poller proxy bound to a given node.

Parameters
nodeNode identity to associate with all forwarded operations.
reactorReactor that owns the actual registration/defer mechanism.

Member Function Documentation

◆ deferCall()

void dfx::Runtime::Api::PollerProxy::deferCall ( FdWatch::Callback cb)
inlineoverridevirtual

Schedule a callback to run later in the reactor context.

Forwards to NodeReactor::deferNodeCall while attaching the node identity.

Parameters
cbCallback to execute later.

Implements dfx::FdWatch::Poller.

◆ deregisterFd()

void dfx::Runtime::Api::PollerProxy::deregisterFd ( FdWatch::BorrowedFd fd)
inlineoverridevirtualnoexcept

Deregister a previously registered file descriptor.

Forwards to NodeReactor::deregisterNodeFd.

Parameters
fdBorrowed FD previously passed to registerFd.

Implements dfx::FdWatch::Poller.

◆ registerFd()

void dfx::Runtime::Api::PollerProxy::registerFd ( FdWatch::BorrowedFd fd,
FdWatch::EventInterests events,
FdWatch::FdCallback cb )
inlineoverride

Register a file descriptor for event notifications.

Forwards to NodeReactor::registerNodeFd while attaching the node identity.

Parameters
fdBorrowed FD to watch (not owned by the poller).
eventsInterest mask (read/write/error, etc.).
cbCallback invoked when the FD becomes ready.

The documentation for this class was generated from the following file: