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 now configurable so time can freeze during backburner run loop #263

Merged
merged 1 commit into from
Sep 20, 2017

Conversation

alias-mac
Copy link
Contributor

This allow us to use fake timers, such as sinon.useFakeTimers, to
check the state of the app during the run loop.

For example: if a popup is supposed to be triggered in X ms from now and
it will show to the user during Y ms, then this will allow us to use
fake timers to pause between X and Y and check the state of the Ember
app at that exact time.

This allow us to use fake timers, such as `sinon.useFakeTimers`, to
check the state of the app during the run loop.

For example: if a popup is supposed to be triggered in X ms from now and
it will show to the user during Y ms, then this will allow us to use
fake timers to pause between X and Y and check the state of the Ember
app at that exact time.
@rwjblue
Copy link
Collaborator

rwjblue commented Sep 20, 2017

This brings now into parity with the other platform concepts (setTimeout, clearTimeout, etc).

@rwjblue rwjblue merged commit 703a4cf into BackburnerJS:master Sep 20, 2017
alias-mac added a commit to alias-mac/backburner.js that referenced this pull request Sep 21, 2017
This allow us to use fake timers, such as `sinon.useFakeTimers`, to
check the state of the app during the run loop.

For example: if a popup is supposed to be triggered in X ms from now and
it will show to the user during Y ms, then this will allow us to use
fake timers to pause between X and Y and check the state of the Ember
app at that exact time.

This is related with BackburnerJS#263, BackburnerJS#179 and BackburnerJS#166.

If someone needs to have the backburner clock separate from the global
stubbed clock (as explained in BackburnerJS#179), then `_platform.now` config should
be used to pass the native `Date.now` function.
@stefanpenner
Copy link
Collaborator

stefanpenner commented Sep 21, 2017

This brings now into parity with the other platform concepts (setTimeout, clearTimeout, etc).
Revert
View details

I think we have it the way it is by design. For example, the autorun flush should not be interuptable.

@rwjblue
Copy link
Collaborator

rwjblue commented Oct 5, 2017

Ya, I think I’m not grok’ing something here. Can we chat about this in higher bandwidth so I can make sure I understand?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants