Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add uncancelable for IO #138

Open
sledorze opened this issue Aug 3, 2018 · 4 comments
Open

Add uncancelable for IO #138

sledorze opened this issue Aug 3, 2018 · 4 comments

Comments

@sledorze
Copy link

sledorze commented Aug 3, 2018

No description provided.

@alexandru
Copy link
Member

👍

@sledorze
Copy link
Author

sledorze commented Aug 4, 2018

@alexandru
I don't have a lot of free time ATM but can come with that if it fits the requirements (looking for validation here)

So the actions would be:

Create a StackedUncancelable in funfix exec that does not nothing.

Implement uncancellable as a static (also as a class member?)

  static uncancellable<A>(io: IO<A>) {
    return IO.asyncUnsafe<A>((ctx, cb) => {
      const ec = ctx.scheduler;
      ec.trampoline(() => {
        const conn = stackedUncancelableRef; // stackedUncancelableRef being a singleton instance of StackedUncancelable defined in funfix-effect
        IO.unsafeStart(io, ctx, ioSafeCallback(ec, conn, cb));
      });
    });
    return io;
  }

Add the flow definitions (not versed into it, but looks definitely possible)

Everything with tests and frenchy english comments!

@sledorze
Copy link
Author

sledorze commented Aug 6, 2018

@alexandru sorry to bug you, but can you confirm / infirm on the approach?

@sledorze
Copy link
Author

sledorze commented Sep 17, 2018

@alexandru pinging again as I need safe cancellation to hit prod quite soon (not joking).
And would help making it happen, of course.

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

No branches or pull requests

2 participants