Skip to Content
Hands-On Reactive Programming with Python
book

Hands-On Reactive Programming with Python

by Romain Picard
October 2018
Intermediate to advanced
420 pages
10h 26m
English
Packt Publishing
Content preview from Hands-On Reactive Programming with Python

Implementing publish/subscribe

Time has come for the last example of this book, once again using both AsyncIO and RxPY. This last example is an implementation of the publish/subscribe communication pattern on a TCP connection. Two applications will be implemented here: the publisher, implemented in a TCP server, and the subscriber, implemented in a TCP client.

The publisher emits either an observable of four numbers (1, 2, 3, 4), or an observable containing the "let's go" string, each time a remote observer subscribes to it. The observable being returned depends on a parameter provided by the subscriber. The publisher supports several clients connected at the same time, and routes the items to the corresponding client.

Both applications are ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python Programming with Design Patterns

Python Programming with Design Patterns

James W. Cooper

Publisher Resources

ISBN: 9781789138726Supplemental Content