Struct active_standby::primitives::shared::AsLock [−][src]
pub struct AsLock<T> { /* fields omitted */ }
Expand description
Struct for holding tables that can be interacted with like an RwLock, including being shared across threads/tasks via Arc (as opposed to the lockless version which requires independent copies per task).
Implementations
Create a AsLock object for handling active_standby tables.
- t1 & t2 are the two tables which will become the active and standby tables. They must be identical; this is left to the user to enforce.
Create a WriteGuard to allow users to update the the data. There will only be 1 WriteGuard at a time.
This function may be slow because:
- Lock contention on the standby_table. This can occur if a ReadGuard which was created before the last WriteGuard was dropped, still has not itself been dropped.
- Replaying all of the updates that were applied to the last WriteGuard.