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

Wrapping the .cancel() call with setImmediate to mitigate the error #132

Closed
wants to merge 2 commits into from
Closed

Wrapping the .cancel() call with setImmediate to mitigate the error #132

wants to merge 2 commits into from

Conversation

iamrajiv
Copy link
Member

Fixes: #130

@iamrajiv iamrajiv requested a review from huan May 22, 2021 00:13
@@ -92,7 +92,7 @@ test('integration testing', async (t) => {
* Close Client & Server
*/
await new Promise(resolve => setImmediate(resolve))
eventStream.cancel()
setImmediate(() => eventStream.cancel())
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the PR!

Cloud you please explain whether it's necessary to change .cacel() to setImmediate(.cacel()) when we have already a await new Promise(resolve => setImmediate(resolve)) above?

I think we have already achieved the same goal with the await new Promise(resolve => setImmediate(resolve)) because it has waited for the event loop to be cleared before we call .cacel(),

@iamrajiv iamrajiv changed the title Wrapping the .cancel() call with setImmediate seems to mitigate the error Wrapping the .cancel() call with setImmediate to mitigate the error May 22, 2021
@iamrajiv iamrajiv changed the title Wrapping the .cancel() call with setImmediate to mitigate the error [GSoD '21] Wrapping the .cancel() call with setImmediate to mitigate the error May 29, 2021
@iamrajiv iamrajiv changed the title [GSoD '21] Wrapping the .cancel() call with setImmediate to mitigate the error [GSoD 2021] Wrapping the .cancel() call with setImmediate to mitigate the error May 29, 2021
@iamrajiv iamrajiv changed the title [GSoD 2021] Wrapping the .cancel() call with setImmediate to mitigate the error Wrapping the .cancel() call with setImmediate to mitigate the error Jul 10, 2021
@iamrajiv iamrajiv closed this Jul 10, 2021
@iamrajiv iamrajiv deleted the issue_130 branch July 29, 2021 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants