Skip to content

Isolate handling of temporal context and metronome - #7

Merged
edevoogd merged 13 commits into
developfrom
dev/quantizer-driver
May 4, 2021
Merged

Isolate handling of temporal context and metronome#7
edevoogd merged 13 commits into
developfrom
dev/quantizer-driver

Conversation

@edevoogd

@edevoogd edevoogd commented Apr 18, 2021

Copy link
Copy Markdown
Owner

Some of the more intricate pieces of ClockQuantizer were pulled out and wrapped in a TemporalContextDriver shim that abstracts the following items:

  • Attach to an external ISystemClockTemporalContext, if one is provided
  • Standardized exposure of ClockAdjusted and MetronomeTicked events
  • Standing up an "internal" metronome if there is no external ISystemClockTemporalContext or if a provided ISystemClockTemporalContext does not provide a metronome.
  • Quiescing support
    • Stopping any metronome events being fired from it. On top of this, if the TemporalContextDriver provides the "internal" metronome, timer resources are freed up while in quiescent state.
    • Retaining (buffering) only the last "clock adjusted" occurrence until the TemporalContextDriver is taken out of quiescing state
  • Accounting for discrepancies in (absent) IAsyncDisposable support of System.Threading.Timer between TFMs

In order to clean things up a bit more, bool ISystemClockTemporalContext.ProvidesMetronome was changed to TimeSpan? ISystemClockTemporalContext.MetronomeIntervalTimeSpan. This allows implementers to not only specify the fact that an external metronome is being provided, but also its interval time-span.

@edevoogd
edevoogd marked this pull request as draft April 18, 2021 11:23
@edevoogd
edevoogd marked this pull request as ready for review May 4, 2021 01:30
@edevoogd
edevoogd merged commit 9158c88 into develop May 4, 2021
@edevoogd
edevoogd deleted the dev/quantizer-driver branch May 4, 2021 01:40
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.

1 participant