1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! Lock-free publication of a "ready" data-plane handle.
//!
//! # Design goals
//! - **Lock-free hot read**: data-plane methods load the latest handle without locks.
//! - **Immediate invalidation**: on disconnect/failure the handle is cleared.
//! - **Cheap clone**: `Arc` is used as the handle carrier.
use ArcSwapOption;
use Arc;
/// A lock-free cell holding an optional `Arc` handle.
///
/// # Performance
/// - `load()` is lock-free and cheap; it performs an atomic load and clones the `Arc`.
/// - `store()` is lock-free and performs an atomic swap.