Class PidCache

Class Documentation

class PidCache

Cache for node-to-PID mappings with TTL-based refresh.

Public Functions

explicit PidCache(std::chrono::steady_clock::duration ttl = std::chrono::seconds{10})
std::optional<pid_t> lookup(const std::string &node_fqn, const std::string &root = "/")

Lookup PID for a node FQN (e.g. “/namespace/node_name”). Refreshes if TTL expired.

void refresh(const std::string &root = "/")

Force refresh the cache by rescanning /proc.

size_t size() const

Number of cached entries.