![]() |
Mads
Multi-Agent Distributed System
|
#include <watcher.hpp>
Public Member Functions | |
| Watcher (const std::string &file_name, std::chrono::duration< float > to=0s) | |
| ~Watcher () | |
| void | watch (const std::function< void(const std::string &)> &callback) |
| Watch the file, invoking the callback on each modification. | |
| void | stop () |
| Ask a running watch() loop to return. | |
Definition at line 31 of file watcher.hpp.
|
inline |
Definition at line 33 of file watcher.hpp.
|
inline |
Definition at line 60 of file watcher.hpp.
|
inline |
Ask a running watch() loop to return.
Safe to call from any thread; watch() returns within its current wait (bounded to about a second) plus the 200 ms poll interval.
Definition at line 95 of file watcher.hpp.
|
inline |
Watch the file, invoking the callback on each modification.
Blocks the calling thread until stop() is called (typically from another thread) or a process-wide stop is requested (Mads::Runtime::stop_process(), e.g. on SIGINT). Platform waits are bounded, so the loop notices a stop request within about a second.
Definition at line 81 of file watcher.hpp.