Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add the ability to return a metric collection via callback #23

Merged
merged 10 commits into from
Oct 28, 2022

Conversation

janstenpickle
Copy link
Contributor

No description provided.

@@ -766,26 +696,40 @@ object JavaMetricRegistry {
): Resource[F, JavaMetricRegistry[F]] = {
val acquire = for {
ref <- Ref.of[F, State](Map.empty)
collectionCallbacksRef <- Ref.of[F, Map[Option[
Metric.Prefix
], (Map[Label.Name, String], NonEmptySeq[F[MetricCollection]])]](Map.empty)
sem <- Semaphore[F](1L)
dis <- Dispatcher[F].allocated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we not just do

Dispatcher[F].flatMap { dis =>
  val acquire = ...
}

instead of using allocated

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah 🤦

@janstenpickle janstenpickle merged commit 871f587 into main Oct 28, 2022
@janstenpickle janstenpickle deleted the multi-callback branch October 28, 2022 13:44
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants