Skip to content

Conversation

@felixbr
Copy link
Contributor

@felixbr felixbr commented Mar 15, 2020

When using fs2 often an instance of cats.effect.Timer[F] is needed for delays, throttling and time-based buffering of streams.

I added RerunnableTimer and the transitive requirement RerunnableClock which help contruct such an instance easily.

RerunnableClock is extremely close to the implementation in cats-effect and the tests are mostly for coverage as the code is really quite simple.

RerunnableTimer is based on com.twitter.util.Timer, which makes things straightforward.

@travisbrown travisbrown self-requested a review March 16, 2020 08:10
Copy link
Contributor

@travisbrown travisbrown left a comment

Choose a reason for hiding this comment

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

Looks good to me! 👍 after format.

By the way feel free to relax -Yno-predef if you'd prefer. I like being made aware of implicit conversions, etc. in performance-sensitive code, but I think it's less useful now than it was a few years ago.

@codecov-io
Copy link

codecov-io commented Mar 16, 2020

Codecov Report

Merging #215 into master will decrease coverage by 1.02%.
The diff coverage is 77.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #215      +/-   ##
==========================================
- Coverage   93.98%   92.95%   -1.03%     
==========================================
  Files           5        7       +2     
  Lines         133      142       +9     
  Branches        3        3              
==========================================
+ Hits          125      132       +7     
- Misses          8       10       +2     
Impacted Files Coverage Δ
...scala/io/catbird/util/effect/RerunnableTimer.scala 66.66% <66.66%> (ø)
...scala/io/catbird/util/effect/RerunnableClock.scala 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a7092a4...5378bfc. Read the comment docs.

@travisbrown
Copy link
Contributor

Feel free to merge when ready, @felixbr.

@felixbr felixbr merged commit d36020e into typelevel:master Mar 16, 2020
@felixbr felixbr deleted the rerunnable-timer branch March 16, 2020 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants