Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

Add uncancelable for IO #138

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

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants