HomePhabricator

Make the main processing loop async wrt the main entry point

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

Description

Make the main processing loop async wrt the main entry point

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

Reviewers: Ottomata, Pchelolo, mobrovac

Reviewed By: mobrovac

Differential Revision: https://phabricator.wikimedia.org/D1089

Details

Committed
mobrovacJul 27 2018, 11:19 AM
Reviewer
mobrovac
Differential Revision
D1089: Make the main processing loop async wrt the main entry point
Parents
rWKSE302e6ffb3a1d: Provide better stream and error handling
Branches
Unknown
Tags
Unknown
ChangeId
None
Build Status
Buildable 3079
Build 5148: ci-jessieJenkins