Explore Twisted, the Python-based event-driven networking engine, and review several of its most popular application projects. It is written by community leaders who have contributed to many of the projects covered, and share their hard-won insights and experience.
Expert Twisted starts with an introduction to event-driven programming, explaining it in the context of what makes Twisted unique. It shows how Twisted's design emphasizes testability as a solution to common challenges of reliability, debugging, and start-to-finish causality that are inherent in event-driven programming. It also explains asynchronous programming, and the importance of functions, deferreds, and coroutines. It then uses two popular applications, treq and klein, to demonstrate calling and writing Web APIs with Twisted.
The second part of the book dives into Twisted projects, in each case explaining how the project fits into the Twisted ecosystem and what it does, and offers several examples to bring readers up to speed, with pointers to additional resources for more depth. Examples include using Twisted with Docker, as a WSGI container, for file sharing, and more.
What You'll Learn
• Integrate Twisted and asyncio using adapters
• Automate software build, test, and release processes with Buildbot
• Create clients and servers with Autobahn
• Transfer files with Magic Wormhole
• Distribute cloud-based file storage with Tahoe LAFS
• Understand HTTP/2 with Python and Twisted
• Support for asynchronous tasks using Django Channels
Who This Book Is For
Readers should have some Python experience and understand the essentials of containers and protocols, but need not be familiar with Twisted or the associated projects covered in the book.
Author(s): Mark Williams, Cory Benfield, Brian Warner, Moshe Zadka, Dustin Mitchell, Kevin Samuel, Pierre Tardy
Edition: 1
Publisher: Apress
Year: 2019
Language: English
Commentary: True PDF
Pages: 382
Tags: Python; Asynchronous Programming; Microservices; Docker; Networking; Django; Callback Functions; Generators; Twisted; Event-Driven Programming; Coroutines; treq; Klein
Front Matter ....Pages i-xix
Front Matter ....Pages 1-1
An Introduction to Event-Driven Programming with Twisted (Mark Williams, Cory Benfield, Brian Warner, Moshe Zadka, Dustin Mitchell, Kevin Samuel et al.)....Pages 3-58
An Introduction to Asynchronous Programming with Twisted (Mark Williams, Cory Benfield, Brian Warner, Moshe Zadka, Dustin Mitchell, Kevin Samuel et al.)....Pages 59-107
Applications with treq and Klein (Mark Williams, Cory Benfield, Brian Warner, Moshe Zadka, Dustin Mitchell, Kevin Samuel et al.)....Pages 109-154
Front Matter ....Pages 155-155
Twisted in Docker (Mark Williams, Cory Benfield, Brian Warner, Moshe Zadka, Dustin Mitchell, Kevin Samuel et al.)....Pages 157-178
Using Twisted as a WSGI Server (Mark Williams, Cory Benfield, Brian Warner, Moshe Zadka, Dustin Mitchell, Kevin Samuel et al.)....Pages 179-221
Tahoe-LAFS: The Least-Authority File System (Mark Williams, Cory Benfield, Brian Warner, Moshe Zadka, Dustin Mitchell, Kevin Samuel et al.)....Pages 223-251
Magic Wormhole (Mark Williams, Cory Benfield, Brian Warner, Moshe Zadka, Dustin Mitchell, Kevin Samuel et al.)....Pages 253-284
Push Data to Browsers and Micro-services with WebSocket (Mark Williams, Cory Benfield, Brian Warner, Moshe Zadka, Dustin Mitchell, Kevin Samuel et al.)....Pages 285-304
Applications with asyncio and Twisted (Mark Williams, Cory Benfield, Brian Warner, Moshe Zadka, Dustin Mitchell, Kevin Samuel et al.)....Pages 305-316
Buildbot and Twisted (Mark Williams, Cory Benfield, Brian Warner, Moshe Zadka, Dustin Mitchell, Kevin Samuel et al.)....Pages 317-338
Twisted and HTTP/2 (Mark Williams, Cory Benfield, Brian Warner, Moshe Zadka, Dustin Mitchell, Kevin Samuel et al.)....Pages 339-363
Twisted and Django Channels (Mark Williams, Cory Benfield, Brian Warner, Moshe Zadka, Dustin Mitchell, Kevin Samuel et al.)....Pages 365-371
Correction to: Expert Twisted: Event-Driven and Asynchronous Programming with Python (Mark Williams, Cory Benfield, Brian Warner, Moshe Zadka, Dustin Mitchell, Kevin Samuel et al.)....Pages C1-C1
Back Matter ....Pages 373-382