Аннотация
Twisted is a powerful, well-tested, and mature concurrent networking library and framework. As we’ll see in this book, many projects and individuals have used it to great effect for more than a decade.
At the same time, Twisted is large, complicated, and old. Its lexicon teems with strange names, like “reactor,” “protocol,” “endpoint,” and “Deferred.” These describe a philosophy and architecture that have baffled both newcomers and old hands with years of Python experience.
Two fundamental programming paradigms inform Twisted’s pantheon of APIs: event-driven programming and asynchronous programming. The rise of JavaScript and the introduction of asyncio into the Python standard library have brought both further into the mainstream, but neither paradigm dominates Python programming so completely that merely knowing the language makes them familiar. They remain specialized topics reserved for intermediate or advanced programmers.
This chapter and the next introduce the motivations behind event-driven and asynchronous programming, and then show how Twisted employs these paradigms. They lay the foundation for later chapters that explore real-world Twisted programs.
We’ll begin by exploring the nature of event-driven programming outside of the context of Twisted. Once we have a sense of what defines event-driven programming, we’ll see how Twisted provides software abstractions that help developers write clear and effective event-driven programs. We’ll also stop along the way to learn about some of the unique parts of those abstractions, like interfaces, and explore how they’re documented on Twisted’s website.
By the end of this chapter you’ll know Twisted terminology: protocols, transports, reactors, consumers, and producers. These concepts form the foundation of Twisted’s approach to event-driven programming, and knowing them is essential to writing useful software with Twisted.
Комментарии к книге "Expert Twisted [Event-Driven and Asynchronous Programming with Python]"