The from_callback operator

The from_callback operator is a higher order function. It returns a function that returns an observable. This observable emits a single item: the result of a callback function provided as a parameter of the operator. This callback function is called when the observable is being subscribed. The marble diagram of this operator is shown in the following figure:

Figure 4.10: The from_callback operator

Its prototype is as follows:

Observable.from_callback(func, selector=None)

The return value of the from_callback operator is a function. This function returns an observable, and must be called with the parameters to pass ...

Get Hands-On Reactive Programming with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.