pub(crate) static EVENT_SUBSCRIBERS: [AtomicUsize; 1]
Expand description
An array containing one AtomicUsize
for each TorEventKind
, used to track subscriptions.
When a TorEventReceiver
subscribes to a TorEventKind
, it uses its usize
value to index
into this array and increment the associated AtomicUsize
(and decrements it to unsubscribe).
This lets event emitters check whether there are any subscribers, and avoid emitting events
if there aren’t.