How Deferred and Promise work together
3.xIn this library, a Deferred represents a computation or unit of work that may not have completed yet (the process), while a Promise represents the eventual result of that computation (the placeholder).
Typically, you create a Deferred object to manage an asynchronous operation. You then use $deferred->promise() to obtain a Promise that you can return to consumers. The Deferred object retains the authority to resolve or reject that promise.