concept future in category system administration

This is an excerpt from Manning's book Functional and Reactive Domain Modeling.
Here, each of the individual functions no longer makes the promise that it will return a Balance before giving control back to the main thread of execution. Instead, it returns a Future, which is sort of a placeholder for the computation. A Future makes a promise that it will give you a Balance eventually, when the computation of the function completes.
In the example in sections 6.2.1 and 6.2.2, say you compose the Future-based operations of AccountService as follows:
for { _ <- open(..) _ <- credit(..) d <- debit(..) } yield dThen the composed operation is a Future, but the individual operations making up the for-comprehension will be sequential. Here you gain from the fact that the composed operation doesn’t block the main thread of execution, and you can retrieve the results when it completes. And this is indeed the valid way to execute the preceding use case; making the individual operations execute in parallel will obviously lead to unwanted nondeterminism.
But in some use cases you can benefit by making the granular operations execute in parallel. Chapter 1 described one such use case in a discussion on event-driven programming using Futures. In this section, you’ll consider the implementation in detail. You’ll skim through the design here, but you can get the full implementation in the code repository for the book.
As you’ve seen, Future (from the Scala standard library) and Task (from scalaz.concurrent) offer ways to make your model reactive. Both help you run your APIs asynchronously and in a nonblocking fashion. But the two abstractions have fundamental differences. When you choose which one to use, you need to apply your own judgment:
Future is an abstraction from the standard library, so you don’t have to depend on any third-party library for using Future. Future models a running computation; it abstracts how you build up the computation and how you run it in a single step. This is somewhat unclean as far as the engineering aspects of API design are concerned. Task, on the other hand, has a clear separation between how you form the description of the computation and its execution. You can control the degree of nondeterminism through an explicitly supplied context, a type class named Nondeterminism.[5] Intuitively, this context allows you to supply the exact behavior of nondeterminism that you’d like to model when the task executes. Task is a monad. So when you execute a Task, the default strategy is to bind, just as a monad does. But with an explicitly specified execution context like Nondeterminism, you can change the execution strategy. For example, you can say that you have so many things to execute—instead of doing a sequence of binds, executing them in parallel, and returning the first completed one. 5Have a look at Scalaz source code for more details on Nondeterminism.
This section takes an example from the module APIs designed in chapter 5 and uses futures to make them nonblocking and asynchronous. As mentioned earlier in this chapter, you’ll make a call as to which APIs you need to make nonblocking instead of being blown away in the fandom of making the whole model asynchronous. At the end of this discussion, you’ll see why making these APIs nonblocking is a reasonable strategy.