This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Topic that wrap state processor to produce | |
* - discrete stream of states that was created by publishing `A` | |
* - continuous stream of states that was created by publishing `A` | |
* - subscription to states and updates (S,A) | |
*/ | |
class StateTopic[S, A](stateProcessor: Process1[A, (S, A)], strategy: Strategy) { | |
val topic: Topic[(A or (S, A))] = async.topic[(A or (S, A))](strategy).journal( | |
collect[(A or (S, A)), A]({ case a: A => a }) |> |