Combining Multiple Streams - achalagarwal/keystrokes GitHub Wiki

Given below are two example scenarios for developing a framework to support combining of multiple streams.

TLDR; Need a way to synchronize the two (or more) streams. Need to support async queues when working with multiple streams -- this issue was faced when working with a stream that sends counter and typos.

A simple example:

Stream A: Detect typos with word context Stream B: Detect words without typos

Analyze the two streams to see which word results in the common typos, what are the common characters typed just before the typo occurred as that may give some insight into what induced some of the key typos

This requires combining the two streams, A and B, followed by storing the common typos, the words where the typos were made, and the words where the typos were not made filtered by them containing the most frequent typos.

An example with synchronized event information requirement

Stream A: Detect window changes in i3-wm Stream B: Extract sentences typed

Combine the two streams to create a stream that sends sentences typed in a single context. This information required the stream A to send out an event flag so that there is information about the separation of contexts. When stream A sends out its events, it also needs to send a special event denoting the time and/or a sub special event for inside a time zone like number of characters typed till there.

Then the stream B could be brought upto speed with that special marker or in other words the second stream could be synchronized with the first stream, synchronized on special events.