Create an input channel whose messages are generated by repeatedly invoking the observer function passed as argument upon each read.
Create an input channel whose messages are generated by repeatedly invoking the observer function passed as argument upon each read.
Note: avoid observer pattern. Instead, use IChan
generators (e.g. from(2)
), RIChan
generators (e.g. async
) or, if you really need blocking I/O, a sys.GetChan
.")
the type of messages produced by the observer
An input channel interface carrying messages produced by the observer
Word-at-a-time Rx like API to create a channel...
From Rx documentation: Defines a provider for push-based notification.
See https://rx.codeplex.com/
Use of the Observer pattern is strongly discouraged because it does not permit to maintain state without resorting to mutable variables and because it might block threads in case it does side-effects. Prefer one of the IChan generators molecule.channel.IChan, a result channel molecule.channel.RIChan, or a BlockingIChan molecule.channel.BlockingIChan if side-effects are required.