Lines Matching +full:- +full:- +full:no +full:- +full:progress

11 -----------------
16 * [Promise](#promise-1)
18 * [Deferred](#deferred-1)
29 * [ExtendedPromiseInterface::progress()](#extendedpromiseinterfaceprogress)
32 * [Promise](#promise-2)
47 * [How to use Deferred](#how-to-use-deferred)
48 * [How promise forwarding works](#how-promise-forwarding-works)
49 * [Resolution forwarding](#resolution-forwarding)
50 * [Rejection forwarding](#rejection-forwarding)
51 * [Mixed resolution and rejection forwarding](#mixed-resolution-and-rejection-forwarding)
52 * [Progress event forwarding](#progress-event-forwarding)
53 * [done() vs. then()](#done-vs-then)
59 ------------
64 It also provides several other useful promise-related concepts, such as joining
71 --------
86 ---
96 $promise = $deferred->promise();
98 $deferred->resolve(mixed $value = null);
99 $deferred->reject(mixed $reason = null);
100 $deferred->notify(mixed $update = null);
107 The deprecated `notify` method is for progress notification.
110 See [Promise](#promise-2) for more information.
115 $promise = $deferred->promise();
124 $deferred->resolve(mixed $value = null);
128 having `$onFulfilled` (which they registered via `$promise->then()`) called with
137 $deferred->reject(mixed $reason = null);
143 `$promise->then()`) called with `$reason`.
150 > Deprecated in v2.6.0: Progress support is deprecated and should not be used anymore.
153 $deferred->notify(mixed $update = null);
156 Triggers progress notifications, to indicate to consumers that the computation
157 is making progress toward its result.
160 `$promise->then()`) called with `$update`.
175 * [Promise](#promise-2)
183 $transformedPromise = $promise->then(callable $onFulfilled = null, callable $onRejected = null, cal…
189 The `then()` method registers new fulfilled, rejection and progress handlers
197 triggers progress notifications and passed a single argument (whatever it
198 wants) to indicate progress.
215 * [resolve()](#resolve) - Creating a resolved promise
216 * [reject()](#reject) - Creating a rejected promise
218 * [done() vs. then()](#done-vs-then)
227 * [Promise](#promise-1)
235 $promise->done(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = nu…
250 * [done() vs. then()](#done-vs-then)
255 $promise->otherwise(callable $onRejected);
261 $promise->then(null, $onRejected);
269 ->otherwise(function (\RuntimeException $reason) {
273 ->otherwise(function ($reason) {
281 $newPromise = $promise->always(callable $onFulfilledOrRejected);
286 It arranges for `$onFulfilledOrRejected` to be called, with no arguments,
321 ->otherwise('handleError')
322 ->always('cleanup');
325 #### ExtendedPromiseInterface::progress()
327 > Deprecated in v2.6.0: Progress support is deprecated and should not be used anymore.
330 $promise->progress(callable $onProgress);
333 Registers a handler for progress updates from promise. It is a shortcut for:
336 $promise->then(null, null, $onProgress);
348 $promise->cancel();
351 The `cancel()` method notifies the creator of the promise that there is no
355 a promise has no effect.
359 * [Promise](#promise-1)
372 // resolve or reject. You can notify of progress events (deprecated)
395 * `$resolve($value)` - Primary function that seals the fate of the
396 returned promise. Accepts either a non-promise value, or another promise.
397 When called with a non-promise value, fulfills promise with that value.
400 * `$reject($reason)` - Function that rejects the promise. It is recommended to
402 * `$notify($update)` - Deprecated function that issues progress events for the promise.
449 return $deferred->promise();
455 $promise->then(function ($value) {
556 to resolve (that is, when `(count($promisesOrValues) - $howMany) + 1` items
558 `(count($promisesOrValues) - $howMany) + 1` rejection reasons.
593 --------
602 // Execute a Node.js-style function using the callback pattern
605 $deferred->reject($error);
607 $deferred->resolve($result);
612 return $deferred->promise();
616 ->then(
624 // Progress notification triggered, do something with $update
639 The first promise, `$deferred->promise()`, will resolve with the value passed
640 to `$deferred->resolve()` below.
648 $deferred->promise()
649 ->then(function ($x) {
650 // $x will be the value passed to $deferred->resolve() below
654 ->then(function ($x) {
660 ->then(function ($x) {
666 ->then(function ($x) {
673 $deferred->resolve(1); // Prints "Resolve 4"
688 $deferred->promise()
689 ->then(function ($x) {
692 ->otherwise(function (\Exception $x) {
696 ->otherwise(function (\Exception $x) {
699 new \Exception($x->getMessage() + 1)
702 ->otherwise(function ($x) {
703 echo 'Reject ' . $x->getMessage(); // 3
706 $deferred->resolve(1); // Prints "Reject 3"
717 $deferred->promise()
718 ->then(function ($x) {
721 ->then(function ($x) {
724 ->otherwise(function (\Exception $x) {
727 return $x->getMessage() + 1;
729 ->then(function ($x) {
733 $deferred->resolve(1); // Prints "Mixed 4"
736 #### Progress event forwarding
738 > Deprecated in v2.6.0: Progress support is deprecated and should not be used anymore.
740 In the same way as resolution and rejection handlers, your progress handler
741 **MUST** return a progress event to be propagated to the next link in the chain.
745 progress handler, the update will be propagated through.
747 If your progress handler throws an exception, the exception will be propagated
748 to the next link in the chain. The best thing to do is to ensure your progress
751 This gives you the opportunity to transform progress events at each step in the
754 registering a progress handler.
759 $deferred->promise()
760 ->progress(function ($update) {
763 ->progress(function ($update) {
764 echo 'Progress ' . $update; // 2
767 $deferred->notify(1); // Prints "Progress 2"
798 ->then(
806 throw new ApiErrorException($object->errorMessage);
811 // Here we provide no rejection handler. If the promise returned has been
814 ->done(
824 ->done(
841 You can get the original rejection reason by calling `$exception->getReason()`.
844 -------
847 [New to Composer?](https://getcomposer.org/doc/00-intro.md)
863 -------
873 -------