Summary

In this chapter, we've looked at two ways to support the concurrent processing of multiple pieces of data:

  • The multiprocessing module: Specifically, the Pool class and the various kinds of mappings available to a pool of workers.
  • The concurrent.futures module: Specifically, the ProcessPoolExecutor and ThreadPoolExecutor classes. These classes also support a mapping that will distribute work among workers that are threads or processes.

We've also noted some alternatives that don't seem to fit in well with functional programming. There are numerous other features of the multiprocessing module, but they're not a good fit with functional design. Similarly, the threading and queue modules can be used to build multithreaded applications, but the features aren't a good fit with functional programs.

In the next chapter, we'll look at the operator module. This can be used to simplify some kinds of algorithm. We can use a built-in operator function instead of defining a Lambda form. We'll also look at some techniques to design flexible decision making and to allow expressions to be evaluated in a non-strict order.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset