This ticket is to migrate the existing implementation of the StatsD metric client to ZIO 2.0. The metric client will call the MetricClient.unsafeInstallListener and unsafeRemoveListener methods from ZIO 2.0 here to install a listener that will receive all metric events from the ZIO application. The functionality to start up and shut down the client should be encompassed in a ZIOApp that can be composed with other ZIOApp values using the <> operator on ZIOApp.
object MetricClient {
/**
* Unsafely installs the specified metric listener.
*/
final def unsafeInstallListener(listener: MetricListener): Unit =
metricState.installListener(listener)
/**
* Unsafely removed the specified metric listener.
*/
final def unsafeRemoveListener(listener: MetricListener): Unit =
metricState.removeListener(listener)
}
This ticket is to migrate the existing implementation of the StatsD metric client to ZIO 2.0. The metric client will call the
MetricClient.unsafeInstallListener
andunsafeRemoveListener
methods from ZIO 2.0 here to install a listener that will receive all metric events from the ZIO application. The functionality to start up and shut down the client should be encompassed in aZIOApp
that can be composed with otherZIOApp
values using the<>
operator onZIOApp
.