You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is possible to pass cancellation token to .NET invocation and the request to nodeJS can be cancelled.
However, in the same time nodeJS will still execute JS code for the .NET request which have been already cancelled.
So it will be nice to have cancellation token as argument in JS module execution function so JS code can be also cancelled.
The solution example is below.
It is possible to create simple JS object like below to handle cancellation tokens in nodeJS:
typeCancellationToken{
isCancellationRequested: boolean;
signal: AbortSignal;// can be used to cancel requests from module execution function }
It is possible to pass cancellation token to .NET invocation and the request to nodeJS can be cancelled.
However, in the same time nodeJS will still execute JS code for the .NET request which have been already cancelled.
So it will be nice to have cancellation token as argument in JS module execution function so JS code can be also cancelled.
The solution example is below.
It is possible to create simple JS object like below to handle cancellation tokens in nodeJS:
Initialize the object on request:
Subscribe on request cancellation:
Then this cancellation token can be checked inside module execution function to skip/stop async js code execution.
Feel free to change the provided above solution. This is just example what I expect to have )
The text was updated successfully, but these errors were encountered: