Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

Solutions Exploration #23

Closed
wants to merge 4 commits into from
Closed

Conversation

itaysabato
Copy link

Created a (draft for a) solutions exploration document (as requested) discussing useful capabilities that can be exposed in order to solve some of the "extra" use-cases.

@benjamingr please review and comment. You are welcome to edit and add stuff we've talked about as well - e.g. the "context API" you mentioned and perhaps some of the examples you wrote in our last session.

Thanks.

@benjamingr
Copy link
Member

CC @MadaraUchiha @getify

setTimeoutPromise(50)
.then(() => controller.return());
```
Since the `getController` API only works on promises returned from async function invocations, the invoker can have full control over who gets to abort the operation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you differentiate between Promises created by async functions and ones created with the new Promise constructor? Do you have an internal flag or something?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would really be up to the implementer, but I imagine you can internally map promises created for async functions to their controllers. Other kinds of promises would simply have no mapping (and no controller).

@targos
Copy link
Member

targos commented Jan 2, 2019

Closing this issue because the repository is being archived: nodejs/admin#283

@targos targos closed this Jan 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants