Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(MesosStateStore): adjust stream data handling
Use `Promise.resolve().then()` to trigger the stream subscription asynchronously on the same macrotask (by using a microtask). Events emitted by the strean, trigger `onStreamData` which is used to emit an event (using EventEmitter) called `MESOS_STATE_CHANGE`. This change will mitigate issues in which errors in view components lead to stale data because the error propagation broke the stream. N.B. `EventEmitter` is synchronous meaning that every delay in an event handler effects the `emit` execution time and errors propagate up to the `emit` call which sometimes leads to undesireable behavior. Closes DCOS-21784
- Loading branch information