Skip to main content

Module sync

Module sync 

Source
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: mpsc and broadcast channels are shadowed by instrumented wrappers. Every successful send or try_send emits a tracing::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, or broadcast.
  • message_type: Inferred from the generic type T.
  • module_path: Inferred from the caller’s location using #[track_caller].

Modules§

broadcast
Instrumented broadcast channels.
futures
Named future types.
mpsc
Instrumented mpsc channels.
oneshot
A one-shot channel is used for sending a single message between asynchronous tasks. The channel function is used to create a Sender and Receiver handle 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.
OnceCell
A thread-safe cell that can be written to only once.
OwnedRwLockReadGuard
Owned RAII structure used to release the shared read access of a lock when dropped.
OwnedRwLockWriteGuard
Owned RAII structure used to release the exclusive write access of a lock when dropped.
OwnedSemaphorePermit
An owned permit from the semaphore.
RwLock
An asynchronous reader-writer lock.
RwLockReadGuard
RAII structure used to release the shared read access of a lock when dropped.
RwLockWriteGuard
RAII structure used to release the exclusive write access of a lock when dropped.
Semaphore
Counting semaphore performing asynchronous permit acquisition.
SemaphorePermit
A permit from the semaphore.
TryLockError
Error returned from the Mutex::try_lock, RwLock::try_read and RwLock::try_write functions.

Traits§

TypeChannelName
Trait used to provide a semantic name for a type in telemetry pulses.