Attributes
- Companion
- object
- Source
- BatchCallback.scala
- Graph
-
- Supertypes
Members list
Value members
Abstract methods
Constructs a batch callback.
Constructs a batch callback.
Batch callbacks allow a single callback to observe measurements for multiple asynchronous instruments.
The callback will be called when the instruments are being observed.
Callbacks are expected to abide by the following restrictions:
-
Short-living and (ideally) non-blocking
-
Run in a finite amount of time
-
Safe to call repeatedly, across multiple threads
Value parameters
- callback
-
the callback to to observe values on-demand
- observable
-
the instrument for which the callback may observe values
- rest
-
the instruments for which the callback may observe values
Attributes
- Example
-
val meter: Meter[F] = ??? val server: F[Unit] = ??? // runs the server val background: Resource[F, Unit] = for { counter <- Resource.eval(meter.observableCounter[Long]("counter").createObserver) upDownCounter <- Resource.eval(meter.observableUpDownCounter[Double]("up-down-counter").createObserver) gauge <- Resource.eval(meter.observableGauge[Double]("gauge").createObserver) callback = counter.record(1L) *> upDownCounter.record(2.0) *> gauge.record(3.0) _ <- meter.batchCallback(callback, counter, upDownCounter, gauge) } yield () background.surround(server) // register batch callback and run the server
- Source
- BatchCallback.scala
Concrete methods
Constructs a batch callback.
Constructs a batch callback.
Batch callbacks allow a single callback to observe measurements for multiple asynchronous instruments.
The callback will be called when the instruments are being observed.
Callbacks are expected to abide by the following restrictions:
-
Short-living and (ideally) non-blocking
-
Run in a finite amount of time
-
Safe to call repeatedly, across multiple threads
Attributes
- Example
-
val meter: Meter[F] = ??? val server: F[Unit] = ??? // runs the server val background: Resource[F, Unit] = meter.batchCallback.of( meter.observableCounter[Long]("counter").createObserver, meter.observableUpDownCounter[Double]("up-down-counter").createObserver, meter.observableGauge[Double]("gauge").createObserver ) { (counter, upDownCounter, gauge) => counter.record(1L) *> upDownCounter.record(2.0) *> gauge.record(3.0) } background.surround(server) // register batch callback and run the server
- Source
- BatchCallback.scala
Attributes
- Source
- BatchCallback.scala
Attributes
- Source
- BatchCallback.scala
Attributes
- Source
- BatchCallback.scala
Attributes
- Source
- BatchCallback.scala
Attributes
- Source
- BatchCallback.scala
Attributes
- Source
- BatchCallback.scala
Attributes
- Source
- BatchCallback.scala