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
A Bergson realtime clock initializes its time member to the current now time when it is constructed. However, by default, clocks don't start ticking (and thus regularly updating their time until the start() method has been called on them.
As a result, when start() is called, it will appear to clock observers as if time suddenly leaps forward from the creation time to the current time. This means that any events that were "optimistically" scheduled while the clock was not ticking, with the intention of their timers starting when the clock starts ticking, will actually be scheduled to occur right away.
This may be what users want, or it may not. It is probably advisable for users to either:
ensure that the clock is running constantly, or
avoid scheduling any events until the clock has started and the next onTick event fires.
Or, alternatively, perhaps a berg.scheduler instance should simply refuse to schedule any new events while its clock isn't ticking?
If not the latter, we should improve the documentation to ensure that this issue is noted and provide solutions for avoiding it.
The text was updated successfully, but these errors were encountered:
* master:
Bumps version to 0.14.0
Fixesgh-17: Allows users to specify an interval for repeating events.
Fixesgh-23: Removes worker termination when the clock stops. Fixes bug in worker implementation where freq was not being read properly.
Excludes older/non-standard browsers from testem list.
A Bergson realtime clock initializes its
time
member to the current now time when it is constructed. However, by default, clocks don't start ticking (and thus regularly updating theirtime
until thestart()
method has been called on them.As a result, when
start()
is called, it will appear to clock observers as if time suddenly leaps forward from the creation time to the current time. This means that any events that were "optimistically" scheduled while the clock was not ticking, with the intention of their timers starting when the clock starts ticking, will actually be scheduled to occur right away.This may be what users want, or it may not. It is probably advisable for users to either:
onTick
event fires.Or, alternatively, perhaps a
berg.scheduler
instance should simply refuse to schedule any new events while its clock isn't ticking?If not the latter, we should improve the documentation to ensure that this issue is noted and provide solutions for avoiding it.
The text was updated successfully, but these errors were encountered: