Crate sc_utils

source ·
Expand description

Utilities Primitives for Substrate

This crate provides mpsc::tracing_unbounded function that returns wrapper types to async_channel::Sender<T> and async_channel::Receiver<T>, which register every send/received/dropped action happened on the channel.

Also this wrapper creates and registers a prometheus vector with name unbounded_channel_len and labels:

LabelDescription
entityName of channel passed to tracing_unbounded
actionOne of send/received/dropped

Modules

  • Produce opaque sequential IDs.
  • Metering primitives and globals
  • Code to meter unbounded channels.
  • Provides mpsc notification channel that can be instantiated after it’s been shared to the consumer and producers entities.
  • Provides means to implement a typical Pub/Sub mechanism.