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

Make timers act like normal ops #1915

Merged
merged 2 commits into from Mar 12, 2019

Conversation

2 participants
@ry
Copy link
Collaborator

ry commented Mar 12, 2019

This is in preperation for core integration.

@ry ry force-pushed the ry:timer branch from aabc29f to aaf9443 Mar 12, 2019

@ry ry requested a review from piscisaureus Mar 12, 2019

@ry ry force-pushed the ry:timer branch from 82f60b4 to b351eff Mar 12, 2019

@ry ry force-pushed the ry:timer branch from b351eff to 9cde419 Mar 12, 2019

Make timers act like normal ops
This is in preperation for core integration.

@ry ry force-pushed the ry:timer branch from 9cde419 to 5e14b4a Mar 12, 2019

@ry ry referenced this pull request Mar 12, 2019

Closed

Integrate src/ with core/ #1919

};
isolate.set_timeout_due(timeout_due);
let mut t = isolate.state.global_timer.lock().unwrap();
t.cancel();

This comment has been minimized.

@piscisaureus

piscisaureus Mar 12, 2019

Collaborator

Two questions:

  • Does this make the global timer future report a failure, or will it simply never complete at all?
  • Does this take effect synchronously? That is: if the the tokio delay has fired in the interim, will cancelling it pre-empt the future from (successfully) completing?

This comment has been minimized.

@ry

ry Mar 12, 2019

Author Collaborator
  • The global timer's errors are ignored (actually it panics) it only reports completion.
  • When you cancel, if an existing timer future exists, it will complete successfully. b
  • The canceled timer's callback is not triggered synchronously. At some point in the future the response Buf from the completed future gets written to the shared buffer, than then shuffled over to JS for its promise to be resolved.
  • Cancelation and Timeout are not distinguished currently - so whether the pending future is canceled or completes - it is the same.
@piscisaureus
Copy link
Collaborator

piscisaureus left a comment

I have a question. I

@ry ry merged commit 58cc69f into denoland:master Mar 12, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
license/cla Contributor License Agreement is signed.
Details

@ry ry deleted the ry:timer branch Mar 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.