Lines Matching refs:a

6 for a general introduction to promises.
25 - Promises have a synchronous `wait` method.
27 - Works with any object that has a `then` function.
35 primary way of interacting with a promise is through its `then` method, which
36 registers callbacks to receive either a promise's eventual value or the reason
62 *Resolving* a promise means that you either fulfill a promise with a *value* or
63 reject a promise with a *reason*. Resolving a promises triggers callbacks
68 ## Resolving a promise
70 Promises are fulfilled using the `resolve($value)` method. Resolving a promise
71 with any value other than a `GuzzleHttp\Promise\RejectedPromise` will trigger
72 all of the onFulfilled callbacks (resolving a promise with a rejected promise
81 // Return a value and don't break the chain
98 Promises can be chained one after the other. Each then in the chain is a new
99 promise. The return value of a promise is what's forwarded to the next
100 promise in the chain. Returning a promise in a `then` callback will cause the
128 When a promise is rejected, the `$onRejected` callbacks are invoked with the
161 You can also forward a rejection down the promise chain by returning a
179 If an exception is not thrown in a `$onRejected` callback and the callback
180 does not return a rejected promise, downstream `$onFulfilled` callbacks are
200 You can synchronously force promises to complete using a promise's `wait`
201 method. When creating a promise, you can provide a wait function that is used
202 to synchronously force a promise to complete. When a wait function is invoked
203 it is expected to deliver a value to the promise or reject the promise. If the
204 wait function does not deliver a value, then an exception is thrown. The wait
205 function provided to a promise constructor is invoked when the `wait` function
217 If an exception is encountered while invoking the wait function of a promise,
228 Calling `wait` on a promise that has been fulfilled will not trigger the wait
237 Calling `wait` on a promise that has been rejected will throw an exception. If
239 Otherwise, a `GuzzleHttp\Promise\RejectionException` is thrown and the reason
251 ## Unwrapping a promise
253 When synchronously waiting on a promise, you are joining the state of the
256 called "unwrapping" the promise. Waiting on a promise will by default unwrap
259 You can force a promise to resolve and *not* unwrap the state of the promise
270 When unwrapping a promise, the resolved value of the promise will be waited
271 upon until the unwrapped value is not a promise. This means that if you resolve
272 promise A with a promise B and unwrap promise A, the value returned by the
280 You can cancel a promise that has not yet been fulfilled using the `cancel()`
281 method of a promise. When creating a promise you can provide an optional
282 cancel function that when invoked cancels the action of computing a resolution
291 When creating a promise object, you can provide an optional `$waitFn` and
292 `$cancelFn`. `$waitFn` is a function that is invoked with no arguments and is
293 expected to resolve the promise. `$cancelFn` is a function with no arguments
294 that is expected to cancel the computation of a promise. It is invoked when the
295 `cancel()` method of a promise is called.
306 // a socket, cancel a database query, etc...)
317 …Appends fulfillment and rejection handlers to the promise, and returns a new promise resolving to …
321 …Appends a rejection handler callback to the promise, and returns a new promise resolving to the re…
327 `$unwrap` controls whether or not the value of the promise is returned for a
354 A fulfilled promise can be created to represent a promise that has been
371 A rejected promise can be created to represent a promise that has been
388 This library works with foreign promises that have a `then` method. This means
390 for example. When a foreign promise is returned inside of a then method
394 // Create a React promise
398 // Create a Guzzle promise that is fulfilled with a React promise.
408 a foreign promise. You will need to wrap a third-party promise with a Guzzle
415 asynchronously using a task queue. When waiting on promises synchronously, the
430 For example, you could use Guzzle promises with React using a periodic timer:
437 *TODO*: Perhaps adding a `futureTick()` on each tick would be faster?
459 // The stack size remains constant (a good thing)
470 When a promise is fulfilled or rejected with a non-promise value, the promise
474 When a promise is resolved with another promise, the original promise transfers
482 Some promise libraries implement promises using a deferred object to represent
483 a computation and a promise object to represent the delivery of the result of
484 the computation. This is a nice separation of computation and delivery because
491 this without making the handlers of a promise publicly mutable, a promise is
495 deferred, it is a small price to pay for keeping the stack size constant.
500 // The promise is the deferred value, so you can deliver a value to it.
537a security vulnerability within this package, please send an email to security@tidelift.com. All s…