typelevel / typelevel/cats-effect
Proposal: IO#raceMany that accepts collection of IO[T], returns winner and cancels others
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 2.2k
- Forks
- 576
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 18
Description
I've been considering a race scenario implementation for a collection of IOs. Concept itself is similar to IO#race but stretched out to many IOs. Input is a collection of IO[T]. The return value is a race winner (first completed) wrapped as IO[Either[Throwable, T]] while other IOs are canceled.
I've pushed an example to my repo, just have in mind this is quick and dirty effort of one evening ;) Based on original IO#race code.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the linked example in src/main/scala/cats/effect/internals/IORaceCollection.scala and compare it with the existing IO#race implementation. Before coding, clarify the collection API, winner representation, and cancellation behavior; done means the project has an agreed raceMany design implemented with matching behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100