Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Reactive Programming with Python

You're reading from   Hands-On Reactive Programming with Python Event-driven development unraveled with RxPY

Arrow left icon
Product type Paperback
Published in Oct 2018
Publisher Packt
ISBN-13 9781789138726
Length 420 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Romain Picard Romain Picard
Author Profile Icon Romain Picard
Romain Picard
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. An Introduction to Reactive Programming FREE CHAPTER 2. Asynchronous Programming in Python 3. Functional Programming with ReactiveX 4. Exploring Observables and Observers 5. Concurrency and Parallelism in RxPY 6. Implementation of an Audio Transcoding Server 7. Using Third-Party Services 8. Dynamic Reconfiguration and Error Management 9. Operators in RxPY 10. Testing and Debugging 11. Deploying and Scaling Your Application 12. Reactive Streams for Remote Communication 13. A Checklist of Best Practices 14. Assessments 15. Other Books You May Enjoy

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 implemented via Cyclotron. The boilerplate to set up the project is not detailed in this chapter, so that explanations of the...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime