typelevel / typelevel/cats-effect
Possible generalization for Dispatcher#unsafeToFutureCancelable
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 2.2k
- Forks
- 576
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 18
Description
From
def unsafeToFutureCancelable[A](fa: F[A]): (Future[A], () => Future[Unit])
To
def unsafeToFutureCancelable[A](fa: F[A]): (Future[A], F[Unit])
It kind of looks like an odd signature... The caller would just run the cancel token through the Dispatcher again, which is precisely what's being done right now anyways; we're just now being explicit that cancellation is an effect in F. One quirk of this is you can now cancel the cancellation of another effect. It's probably not useful in practice but it gives you that power.
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 Dispatcher#unsafeToFutureCancelable and tracing how its cancellation result is used. Determine the API, compatibility, and cancellation semantics needed for an F[Unit] result, then document the decision and any required implementation scope. Done means the proposed generalization has a clear maintainer-approved design.
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
- 30/100