typelevel / typelevel/cats-effect

Possible generalization for Dispatcher#unsafeToFutureCancelable

Open
#1,571 1 comment 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.