舉報

會員
Hands-On Reactive Programming with Python
Romain Picard 著
更新時間:2021-06-24 18:26:09
開會員,本書免費讀 >
Reactiveprogrammingiscentraltomanyconcurrentsystems,butit’sfamousforitssteeplearningcurve,whichmakesmostdevelopersfeellikethey'rehittingawall.Withthisbook,youwillgettogripswithreactiveprogrammingbysteadilyexploringvariousconceptsThishands-onguidegetsyoustartedwithReactiveProgramming(RP)inPython.YouwilllearnaboutatheprinciplesandbenefitsofusingRP,whichcanbeleveragedtobuildpowerfulconcurrentapplications.Asyouprogressthroughthechapters,youwillbeintroducedtotheparadigmofFunctionalandReactiveProgramming(FaRP),observablesandobservers,andconcurrencyandparallelism.ThebookwillthentakeyouthroughtheimplementationofanaudiotranscodingserverandintroduceyoutoalibrarythathelpsinthewritingofFaRPcode.Youwillunderstandhowtousethird-partyservicesanddynamicallyreconfigureanapplication.Bytheendofthebook,youwillalsohavelearnedhowtodeployandscaleyourapplicationswithDockerandTraefikandexplorethesignificantpotentialbehindthereactivestreamsconcept,andyou'llhavegottogripswithacomprehensivesetofbestpractices.
最新章節
- Leave a review - let other readers know what you think
- Other Books You May Enjoy
- Chapter 13
- Chapter 12
- Chapter 11
- Chapter 10
品牌:中圖公司
上架時間:2021-06-24 17:53:28
出版社:Packt Publishing
本書數字版權由中圖公司提供,并由其授權上海閱文信息技術有限公司制作發行
- Leave a review - let other readers know what you think 更新時間:2021-06-24 18:26:09
- Other Books You May Enjoy
- Chapter 13
- Chapter 12
- Chapter 11
- Chapter 10
- Chapter 9
- Chapter 8
- Chapter 7
- Chapter 6
- Chapter 5
- Chapter 4
- Chapter 3
- Chapter 2
- Chapter 1
- Assessments
- Further reading
- Questions
- Summary
- Be clear on hot and cold observables
- Disposal should not throw exceptions
- Subscriptions should not throw exceptions
- Always specify a scheduler
- Favor composition of existing operators
- Miscellaneous recommendations
- What to do when nothing happens
- Keeping side-effects as small as possible
- The observable creation decision tree
- A Checklist of Best Practices
- Further reading
- Questions
- Summary
- Implementation of the subscriber
- Implementation of a TCP client
- The subscriber
- Implementation of the publisher
- Implementation of a TCP server
- The publisher
- Implementing publish/subscribe
- Routing
- An implementation of JSON serialization
- Serialization
- An implementation of line-based framing
- Framing
- Observable multiplexing
- Request/response
- Channel
- Publish/subscribe
- Communication patterns and observables
- Reactive Streams for Remote Communication
- Further reading
- Questions
- Summary
- Enabling the ACME protocol
- Deploying on a public server
- Introduction to Let's Encrypt
- Adding TLS support with Let's Encrypt
- Using containers for horizontal scaling
- Composing all services
- How images are composed together
- Packaging the audio transcoder
- Starting Traefik
- Installing Docker Compose
- Introduction to Docker Compose
- Packaging a service with Docker Compose
- Traefik principles
- What is a load balancer?
- What is a reverse proxy?
- Reverse proxies and load balancers
- Introduction to Traefik
- Technical requirements
- Deploying and Scaling Your Application
- Further reading
- Questions
- Summary
- Debugging AsyncIO
- Adding traces
- Debugging
- Logging
- Testing AsyncIO code
- Injecting asynchronous obervables
- Testing a custom operator
- Dependency injection versus mock
- Introduction to Python unit testing
- Testing
- Testing and Debugging
- Further reading
- Questions
- Summary
- The sum operator
- The reduce operator
- The min operator
- The max operator
- The count operator
- The concat operator
- The average operator
- Mathematical operators
- The take_while operator
- The take_until operator
- The skip_while operator
- The skip_until operator
- The sequence_equal operator
- The default_if_empty operator
- The contains operator
- The amb operator
- The all operator
- Conditional operators
- The to_list operator
- The using operator
- The timestamp operator
- The timeout operator
- The time_interval operator
- The materialize/dematerialize operators
- The do_action operator
- The delay operator
- Utility operators
- The zip_list operator
- The zip operator
- The switch_latest operator
- The join operator
- Combining observables
- The element_at operator
- The distinct operator
- The sample operator
- The ignore_elements operator
- The take_last operator
- The skip_last operator
- The last operator
- The first operator
- Filtering observables
- The group_by operator
- The window operator
- The buffer operator
- Transforming observables
- Operators in RxPY
- Questions
- Summary
- Error management
- Monitoring changes in the configuration file
- Implementing an inotify driver
- Monitoring the configuration file
- Configuring the audio encoding
- Encode driver reconfiguration
- The combine_latest operator
- The start_with operator
- The distinct_until_changed operator
- The take operator
- The debounce operator
- Operators used for dynamic configuration
- Monitoring file changes with inotify
- Understanding inotify
- Monitoring file changes
- Dynamic Reconfiguration and Error Management
- Further reading
- Questions
- Summary
- Moving the blocking I/O to a dedicated thread
- Using thread pools for CPU-bound operations
- Dealing with blocking API and CPU-bound operations
- Using the S3 driver
- Returning data in the encoding driver
- Implementation of the S3 driver
- Using S3 as storage
- Using Minio as S3 storage
- Getting started with Docker
- Docker installation on Linux
- An introduction to Docker
- Installing Docker and Minio
- An introduction to S3 storage
- Technical requirements
- Using Third-Party Services
- Further reading
- Questions
- Summary
- Using the encoding server
- Putting it all together
- Exposing the REST APIs
- Using the encoder driver
- Implementation of the encoder driver
- Parsing the configuration file
- Implementation of the encoding server
- The let operator
- The flat_map operator
- The filter operator
- The skip operator
- Operators used in this application
- The command-line echo example
- Introduction to Cyclotron
- Avoiding backslashes
- Using dataclasses
- Using named tuples
- Maximizing code readability
- The base structure
- Structuring the project
- Technical requirements
- Implementation of an Audio Transcoding Server
- Questions
- Summary
- The AsyncIO scheduler
- The ThreadPool scheduler
- The NewThread scheduler
- Available schedulers
- Concurrency and schedulers
- Concurrency and Parallelism in RxPY
- Questions
- Summary
- The from_future operator
- The start operator
- Observables and AsyncIO
- The retry operator
- The catch_exception operator
- Error handling
- Custom disposal
- Disposing a subscription
- Subscribing to an observable
- Subscription and disposal
- Operators – ref_count and share
- Operators – publish and connect
- Hot and cold observables
- The create operator
- The from_callback operator
- Custom observables
- The interval operator
- The timer operator
- Observables driven by time
- The never and throw operators
- The repeat operator
- The range operator
- The just operator
- The of operator
- Creating observables from values
- Creating observables
- Exploring Observables and Observers
- Further reading
- Questions
- Summary
- Adding the program logic
- Bootstrapping the event loop
- Implementation of the HTTP server driver
- The merge operator
- The empty operator
- ReactiveX operators
- The HTTP echo server with an HTTP driver
- Structuring functional and reactive code
- Solving the cycle issue with Subject
- ReactiveX Subject
- The observable cycle issue
- Observable cycles
- Functional reactive programming
- Higher-order functions
- Side effects and pure functions
- Closures
- Lambdas
- Some base elements of functional programming
- What is functional programming?
- Functional Programming with ReactiveX
- Further reading
- Questions
- Summary
- An AsyncIO HTTP server
- aiohttp
- An HTTP echo server
- Event loop
- Coroutines
- Futures
- Introduction to AsyncIO
- Using generators for asynchronous handlers
- Understanding generators
- Asynchronous handlers with generators
- Asynchronous handlers with callbacks
- The history of asynchronous programming in Python
- What is asynchronous programming?
- Asynchronous Programming in Python
- Further reading
- Questions
- Summary
- Reactivity diagrams of an echo example
- Reactivity diagram elements
- Reactivity diagrams
- Flow diagrams
- The from_ operator
- The map operator
- Marble diagrams
- A reactive echo application
- Installating RxPY
- Operators
- ReactiveX principles
- Introduction to ReactiveX and RxPY
- Reactive systems
- Reactor and proactor
- Reactive versus proactive
- Event-driven programming
- What is reactive programming?
- An Introduction to Reactive Programming
- Reviews
- Get in touch
- Conventions used
- Download the example code files
- To get the most out of this book
- What this book covers
- Who this book is for
- Preface
- Packt is searching for authors like you
- About the reviewer
- About the author
- Contributors
- Packt.com
- Why subscribe?
- Packt Upsell
- Dedication
- Title Page
- coverpage
- coverpage
- Title Page
- Dedication
- Packt Upsell
- Why subscribe?
- Packt.com
- Contributors
- About the author
- About the reviewer
- Packt is searching for authors like you
- Preface
- Who this book is for
- What this book covers
- To get the most out of this book
- Download the example code files
- Conventions used
- Get in touch
- Reviews
- An Introduction to Reactive Programming
- What is reactive programming?
- Event-driven programming
- Reactive versus proactive
- Reactor and proactor
- Reactive systems
- Introduction to ReactiveX and RxPY
- ReactiveX principles
- Operators
- Installating RxPY
- A reactive echo application
- Marble diagrams
- The map operator
- The from_ operator
- Flow diagrams
- Reactivity diagrams
- Reactivity diagram elements
- Reactivity diagrams of an echo example
- Summary
- Questions
- Further reading
- Asynchronous Programming in Python
- What is asynchronous programming?
- The history of asynchronous programming in Python
- Asynchronous handlers with callbacks
- Asynchronous handlers with generators
- Understanding generators
- Using generators for asynchronous handlers
- Introduction to AsyncIO
- Futures
- Coroutines
- Event loop
- An HTTP echo server
- aiohttp
- An AsyncIO HTTP server
- Summary
- Questions
- Further reading
- Functional Programming with ReactiveX
- What is functional programming?
- Some base elements of functional programming
- Lambdas
- Closures
- Side effects and pure functions
- Higher-order functions
- Functional reactive programming
- Observable cycles
- The observable cycle issue
- ReactiveX Subject
- Solving the cycle issue with Subject
- Structuring functional and reactive code
- The HTTP echo server with an HTTP driver
- ReactiveX operators
- The empty operator
- The merge operator
- Implementation of the HTTP server driver
- Bootstrapping the event loop
- Adding the program logic
- Summary
- Questions
- Further reading
- Exploring Observables and Observers
- Creating observables
- Creating observables from values
- The of operator
- The just operator
- The range operator
- The repeat operator
- The never and throw operators
- Observables driven by time
- The timer operator
- The interval operator
- Custom observables
- The from_callback operator
- The create operator
- Hot and cold observables
- Operators – publish and connect
- Operators – ref_count and share
- Subscription and disposal
- Subscribing to an observable
- Disposing a subscription
- Custom disposal
- Error handling
- The catch_exception operator
- The retry operator
- Observables and AsyncIO
- The start operator
- The from_future operator
- Summary
- Questions
- Concurrency and Parallelism in RxPY
- Concurrency and schedulers
- Available schedulers
- The NewThread scheduler
- The ThreadPool scheduler
- The AsyncIO scheduler
- Summary
- Questions
- Implementation of an Audio Transcoding Server
- Technical requirements
- Structuring the project
- The base structure
- Maximizing code readability
- Using named tuples
- Using dataclasses
- Avoiding backslashes
- Introduction to Cyclotron
- The command-line echo example
- Operators used in this application
- The skip operator
- The filter operator
- The flat_map operator
- The let operator
- Implementation of the encoding server
- Parsing the configuration file
- Implementation of the encoder driver
- Using the encoder driver
- Exposing the REST APIs
- Putting it all together
- Using the encoding server
- Summary
- Questions
- Further reading
- Using Third-Party Services
- Technical requirements
- An introduction to S3 storage
- Installing Docker and Minio
- An introduction to Docker
- Docker installation on Linux
- Getting started with Docker
- Using Minio as S3 storage
- Using S3 as storage
- Implementation of the S3 driver
- Returning data in the encoding driver
- Using the S3 driver
- Dealing with blocking API and CPU-bound operations
- Using thread pools for CPU-bound operations
- Moving the blocking I/O to a dedicated thread
- Summary
- Questions
- Further reading
- Dynamic Reconfiguration and Error Management
- Monitoring file changes
- Understanding inotify
- Monitoring file changes with inotify
- Operators used for dynamic configuration
- The debounce operator
- The take operator
- The distinct_until_changed operator
- The start_with operator
- The combine_latest operator
- Encode driver reconfiguration
- Configuring the audio encoding
- Monitoring the configuration file
- Implementing an inotify driver
- Monitoring changes in the configuration file
- Error management
- Summary
- Questions
- Operators in RxPY
- Transforming observables
- The buffer operator
- The window operator
- The group_by operator
- Filtering observables
- The first operator
- The last operator
- The skip_last operator
- The take_last operator
- The ignore_elements operator
- The sample operator
- The distinct operator
- The element_at operator
- Combining observables
- The join operator
- The switch_latest operator
- The zip operator
- The zip_list operator
- Utility operators
- The delay operator
- The do_action operator
- The materialize/dematerialize operators
- The time_interval operator
- The timeout operator
- The timestamp operator
- The using operator
- The to_list operator
- Conditional operators
- The all operator
- The amb operator
- The contains operator
- The default_if_empty operator
- The sequence_equal operator
- The skip_until operator
- The skip_while operator
- The take_until operator
- The take_while operator
- Mathematical operators
- The average operator
- The concat operator
- The count operator
- The max operator
- The min operator
- The reduce operator
- The sum operator
- Summary
- Questions
- Further reading
- Testing and Debugging
- Testing
- Introduction to Python unit testing
- Dependency injection versus mock
- Testing a custom operator
- Injecting asynchronous obervables
- Testing AsyncIO code
- Logging
- Debugging
- Adding traces
- Debugging AsyncIO
- Summary
- Questions
- Further reading
- Deploying and Scaling Your Application
- Technical requirements
- Introduction to Traefik
- Reverse proxies and load balancers
- What is a reverse proxy?
- What is a load balancer?
- Traefik principles
- Packaging a service with Docker Compose
- Introduction to Docker Compose
- Installing Docker Compose
- Starting Traefik
- Packaging the audio transcoder
- How images are composed together
- Composing all services
- Using containers for horizontal scaling
- Adding TLS support with Let's Encrypt
- Introduction to Let's Encrypt
- Deploying on a public server
- Enabling the ACME protocol
- Summary
- Questions
- Further reading
- Reactive Streams for Remote Communication
- Communication patterns and observables
- Publish/subscribe
- Channel
- Request/response
- Observable multiplexing
- Framing
- An implementation of line-based framing
- Serialization
- An implementation of JSON serialization
- Routing
- Implementing publish/subscribe
- The publisher
- Implementation of a TCP server
- Implementation of the publisher
- The subscriber
- Implementation of a TCP client
- Implementation of the subscriber
- Summary
- Questions
- Further reading
- A Checklist of Best Practices
- The observable creation decision tree
- Keeping side-effects as small as possible
- What to do when nothing happens
- Miscellaneous recommendations
- Favor composition of existing operators
- Always specify a scheduler
- Subscriptions should not throw exceptions
- Disposal should not throw exceptions
- Be clear on hot and cold observables
- Summary
- Questions
- Further reading
- Assessments
- Chapter 1
- Chapter 2
- Chapter 3
- Chapter 4
- Chapter 5
- Chapter 6
- Chapter 7
- Chapter 8
- Chapter 9
- Chapter 10
- Chapter 11
- Chapter 12
- Chapter 13
- Other Books You May Enjoy
- Leave a review - let other readers know what you think 更新時間:2021-06-24 18:26:09