Expand description
Instrumented synchronization primitives and re-exports of tokio::sync.
§Transparent Sync Proxy
This module provides a drop-in replacement for tokio::sync primitives with built-in
telemetry instrumentation for Rerun pulses.
§Architecture
- Release Builds: All types and functions are simple re-exports of
tokio::sync. There is absolute zero runtime cost. - Debug Builds:
mpscandbroadcastchannels are shadowed by instrumented wrappers. Every successfulsendortry_sendemits atracing::trace!pulse that is automatically captured by the core telemetry system.
§Automatic Naming
Metrics are automatically named using the following format:
semantic_name:channel_type:message_type@module_path
- semantic_name: Name provided via mandatory
register_channel_name!. - channel_type:
mpsc,unbounded, orbroadcast. - message_type: Inferred from the generic type
T. - module_path: Inferred from the caller’s location using
#[track_caller].
Modules§
- broadcast
- Instrumented
broadcastchannels. - futures
- Named future types.
- mpsc
- Instrumented
mpscchannels. - oneshot
- A one-shot channel is used for sending a single message between
asynchronous tasks. The
channelfunction is used to create aSenderandReceiverhandle pair that form the channel. - watch
- A multi-producer, multi-consumer channel that only retains the last sent value.
Structs§
- Barrier
- A barrier enables multiple tasks to synchronize the beginning of some computation.
- Mutex
- An asynchronous
Mutex-like type. - Notify
- Notifies a single task to wake up.
- Once
Cell - A thread-safe cell that can be written to only once.
- Owned
RwLock Read Guard - Owned RAII structure used to release the shared read access of a lock when dropped.
- Owned
RwLock Write Guard - Owned RAII structure used to release the exclusive write access of a lock when dropped.
- Owned
Semaphore Permit - An owned permit from the semaphore.
- RwLock
- An asynchronous reader-writer lock.
- RwLock
Read Guard - RAII structure used to release the shared read access of a lock when dropped.
- RwLock
Write Guard - RAII structure used to release the exclusive write access of a lock when dropped.
- Semaphore
- Counting semaphore performing asynchronous permit acquisition.
- Semaphore
Permit - A permit from the semaphore.
- TryLock
Error - Error returned from the
Mutex::try_lock,RwLock::try_readandRwLock::try_writefunctions.
Traits§
- Type
Channel Name - Trait used to provide a semantic name for a type in telemetry pulses.