Chapter 9.  Reactive Extensions in PHP

In this chapter, we'll talk about Reactive extensions in PHP, a PHP library that allows PHP programmers to work with PHP in a reactive manner, and how to use in event, also known as publish-subscribe programming. We'll also discuss the idea of functional programming in PHP and how to program in a more succinct way. We will also discuss the following topics:

  • Map
  • Reduce
  • Defer
  • Reactive extensions in the following use cases:
    • Data analysis of logs (parsing Apache logs)
    • Queueing systems (asynchronously working through a queue of tasks)
    • Events

Reactive extensions are a way to code in a functional way using PHP. They are a set of libraries (available on GitHub at https://github.com/ReactiveX/RxPHP) that can help you compose ...

Get PHP 7 Programming Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.