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

feature: support timestamped 0183 playback with Multiplexedlog #184

Merged
merged 1 commit into from
May 23, 2017

Conversation

tkurki
Copy link
Member

@tkurki tkurki commented May 21, 2017

Previously 0183 playback was output with current time timestamps in
deltas. This commit adds the timestamps to the deltas that 0183 parser
emits. This assumes that 0183 parsing is synchronous so that
the timestamp stored when calling parser.write will be the correct one
when 0183 parser emits deltas.

Previously 0183 playback was output with current time timestamps in
deltas. This commit adds the timestamps to the deltas that 0183
emits. This assumes that 0183 parsing is synchronous so that
the timestamp stored when calling parser.write will be the correct one
when 0183 parser emits deltas.
@tkurki
Copy link
Member Author

tkurki commented May 21, 2017

Ping @fabdrol @joabakk I assume the new 0183 parser will be synchronous as well (not doing setImmediate or nextTick or something else magical).

@fabdrol
Copy link
Member

fabdrol commented May 22, 2017

@tkurki new parser uses promises - because it makes the main code more robust against unhandled exceptions in hooks / parse errors - and also because it means a hook could be async, should that be required for whatever reason.
However, that does mean that the timing will be different than purely synchronous code. If I remember correctly, (native) promises that resolve immediately execute after nextTick but before setImmediate on the event loop.

If I understand your comment, you assert that this is problematic in cases where the timestamp is generated by the parser - i.e. when a sentence doesn't have a timestamp of its own (either in the tag block or in the sentence). One option would be to generate a timestamp in the initial (synchronous) call to parse(), then pass this along to the actual hook.

@tkurki tkurki merged commit 6b009e7 into master May 23, 2017
@timmathews timmathews deleted the 0183-timestamp-support branch December 3, 2017 04:55
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.

2 participants