Make the main processing loop async wrt the main entry point
ClosedPublic

Authored by mobrovac on Jul 27 2018, 11:15 AM.

Details

Reviewers
Ottomata
Pchelolo
mobrovac
Commits
rWKSEfe0df0e409a3: Make the main processing loop async wrt the main entry point
Patch without arc
git checkout -b D1089 && curl -L https://phabricator.wikimedia.org/D1089?download=true | git apply
Summary

By nature, streams are interrupt- (aka event-) based. This makes it
unpractical to incorporate them into the main request's Promise chain.
Therefore, make the processing loop to happen asynchronously with
regards to the main Promise chain, i.e. the library's main entry point.
In the same vein, ensure that the main processing loop "takes a break"
every once in a while so that various interrupts and events can be
processed.

Also use cassandra-uuid instead of node-uuid for generating UUIDs, since
the former is a pure-JS implementation while the latter is a binary
module. Switch from UUID v4 to UUID v1 IDs because UUID v1 is used
throughout the system to generate the x-request-id and it also gives
us a notion of causality between different requests.

Bug: T199813

Diff Detail

Repository
rWKSE KafkaSSE
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mobrovac created this revision.Jul 27 2018, 11:15 AM
mobrovac requested review of this revision.Jul 27 2018, 11:17 AM
mobrovac accepted this revision.Jul 27 2018, 11:17 AM
mobrovac added reviewers: Ottomata, Pchelolo.
This revision is now accepted and ready to land.Jul 27 2018, 11:17 AM
This revision was automatically updated to reflect the committed changes.