-
Notifications
You must be signed in to change notification settings - Fork 608
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
Track queue size of bounded queues #1468
Conversation
@@ -436,6 +436,36 @@ private[fs2] object PubSub { | |||
strategy.unsubscribe(selector, state) | |||
} | |||
|
|||
def withSize[A, S](strategy: PubSub.Strategy[A, Chunk[A], S, Int]) | |||
: PubSub.Strategy[A, Chunk[A], (S, Int), Int] = | |||
new PubSub.Strategy[A, Chunk[A], (S, Int), Int] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strategy that tracks the queue size along with the state S
@by-dam Looks like we need similar changes in the experimental module too. |
…for all queue types (e.g. circular buffers and unbounded inspectable queues)
@by-dam I changed the approach a bit, introducing a new |
Fwiw, I was also a bit unsure whether the size tracking belonged to Queue or PubSub, but couldn't really decide either way |
@SystemFw Yeah, when I getting this PR ready for merge, I noticed |
Yes, let's merge this :) |
@mpilquist Sure, thanks for looking at it |
tentative to address #1448