diff options
| author | Marcos Magueta <maguetamarcos@gmail.com> | 2026-05-08 22:57:05 -0300 |
|---|---|---|
| committer | Marcos Magueta <maguetamarcos@gmail.com> | 2026-05-08 22:57:05 -0300 |
| commit | 0657d6815943b5350bf4a596cd826f7a9de14a90 (patch) | |
| tree | 53d4fbd03731e483f1bd83a58beab64a330c7f1d /include/LifecycleManager.h | |
| parent | be67e04f498f02c601788f2e23913827d2aa3c21 (diff) | |
| download | RNT-0657d6815943b5350bf4a596cd826f7a9de14a90.tar.gz RNT-0657d6815943b5350bf4a596cd826f7a9de14a90.zip | |
port docs to doxygen
Diffstat (limited to '')
| -rw-r--r-- | include/LifecycleManager.h | 61 |
1 files changed, 47 insertions, 14 deletions
diff --git a/include/LifecycleManager.h b/include/LifecycleManager.h index 8bf1a2c..914ce0a 100644 --- a/include/LifecycleManager.h +++ b/include/LifecycleManager.h @@ -3,27 +3,60 @@ #include "Api.h" #include "ObjectManager.h" +/** + * @file LifecycleManager.h + * @brief Declares monitoring, pinning, cleanup, and contention operations. + */ + namespace nt { + /** @brief Manages runtime lifecycle concerns for registry objects. */ class NT_API LifecycleManager { public: - // If object is not being monitored already, monitors the lifecycle by updating the handle count. - // Maybe also look at the reference count and kill some categories of disposable objects no longer referenced by other objects, like transactions. - // One use case is preventing compaction/prunning of history while cursors depend on old database snapshots, for example. - // Think of other use cases later. + /** + * @brief Starts monitoring an object's lifecycle. + * + * If the object is not being monitored already, monitor the lifecycle + * by updating the handle count. Maybe also look at the reference count + * and kill some categories of disposable objects no longer referenced + * by other objects, like transactions. + * + * One use case is preventing compaction/pruning of history while + * cursors depend on old database snapshots, for example. Think of + * other use cases later. + * + * @param object Object to monitor. + */ void Monitor(ObjectManager::registry* object); - // Serializes contention for the change of a mutable reference. - // This can be used in, for example, the HEAD of a branch to serialize the access. - // If the object does not causes contention, like a relation (since they are immutable, just like multigroups, all snapshots) - // then just approve, as they do not cause any contention. Transactions also do not cause any, - // the only things that do are mutable reference states in shared sessions, - // for example: the HEAD of a branch, namespace collisions (creating two branches with the same name, or two multigroups with the same name from the same state, etc), - // multi-branch atomic commits (which I wish to not have as it damages isolation), - // garbage collection of old state (as in, we want to delete an old-enough history to save up space), etc. + + /** + * @brief Serializes contention for changes to mutable references. + * + * This can be used for the HEAD of a branch to serialize access. If the + * object does not cause contention, such as a relation, then this can + * approve the operation because relations and multigroups are immutable + * snapshots. Transactions also do not cause contention. + * + * The objects that do cause contention are mutable reference states in + * shared sessions. Examples include the HEAD of a branch, namespace + * collisions, multi-branch atomic commits (which may damage isolation), + * and garbage collection of old state when old-enough history is removed + * to save space. + * + * @param object Object to check for contention. + * @return True when the operation may proceed. + */ const bool Contention(ObjectManager::registry* object); - // The inverse of `Monitor`, stops monitoring. - // Maybe garbage collect here also if the counters goes to zero. + + /** + * @brief Stops monitoring an object. + * + * The inverse of Monitor. Maybe garbage collect here also if the + * counters go to zero. + * + * @param object Object to stop monitoring. + */ void Unmonitor(ObjectManager::registry* object); }; } |
