/external/cronet/tot/base/android/junit/src/org/chromium/base/ |
D | PromiseTest.java | 24 import org.chromium.base.Promise.UnhandledRejectionException; 29 /** Unit tests for {@link Promise}. */ 52 Promise<Integer> promise = new Promise<>(); in callback() local 53 promise.then(PromiseTest.setValue(value, 1)); in callback() 57 promise.fulfill(1); in callback() 66 Promise<Integer> promise = new Promise<>(); in multipleCallbacks() local 71 promise.then(callback); in multipleCallbacks() 72 promise.then(callback); in multipleCallbacks() 76 promise.fulfill(0); in multipleCallbacks() 80 /** Tests that a callback is called immediately when given to a fulfilled Promise. */ [all …]
|
/external/cronet/stable/base/android/junit/src/org/chromium/base/ |
D | PromiseTest.java | 24 import org.chromium.base.Promise.UnhandledRejectionException; 29 /** Unit tests for {@link Promise}. */ 52 Promise<Integer> promise = new Promise<>(); in callback() local 53 promise.then(PromiseTest.setValue(value, 1)); in callback() 57 promise.fulfill(1); in callback() 66 Promise<Integer> promise = new Promise<>(); in multipleCallbacks() local 71 promise.then(callback); in multipleCallbacks() 72 promise.then(callback); in multipleCallbacks() 76 promise.fulfill(0); in multipleCallbacks() 80 /** Tests that a callback is called immediately when given to a fulfilled Promise. */ [all …]
|
/external/cronet/stable/base/android/java/src/org/chromium/base/ |
D | Promise.java | 18 * A Promise class to be used as a placeholder for a result that will be provided asynchronously. 20 * @param <T> The type the Promise will be fulfilled with. 22 public class Promise<T> { class 47 * A function class for use when chaining Promises with {@link Promise#then(AsyncFunction)}. 51 public interface AsyncFunction<A, RT> extends Function<A, Promise<RT>> {} 54 * An exception class for when a rejected Promise is not handled and cannot pass the rejection 55 * to a subsequent Promise. 79 : "Do not call the single argument Promise.then(Callback) on a Promise that already" in then() 85 "Promise was rejected without a rejection handler.", reason); in then() 93 * Queues {@link Callback}s to be run when the Promise is either fulfilled or rejected. If the [all …]
|
/external/cronet/tot/base/android/java/src/org/chromium/base/ |
D | Promise.java | 18 * A Promise class to be used as a placeholder for a result that will be provided asynchronously. 20 * @param <T> The type the Promise will be fulfilled with. 22 public class Promise<T> { class 47 * A function class for use when chaining Promises with {@link Promise#then(AsyncFunction)}. 51 public interface AsyncFunction<A, RT> extends Function<A, Promise<RT>> {} 54 * An exception class for when a rejected Promise is not handled and cannot pass the rejection 55 * to a subsequent Promise. 79 : "Do not call the single argument Promise.then(Callback) on a Promise that already" in then() 85 "Promise was rejected without a rejection handler.", reason); in then() 93 * Queues {@link Callback}s to be run when the Promise is either fulfilled or rejected. If the [all …]
|
/external/libchrome/base/android/junit/src/org/chromium/base/ |
D | PromiseTest.java | 17 import org.chromium.base.Promise.UnhandledRejectionException; 20 /** Unit tests for {@link Promise}. */ 42 Promise<Integer> promise = new Promise<Integer>(); in callback() local 43 promise.then(PromiseTest.<Integer>setValue(value, 1)); in callback() 47 promise.fulfill(new Integer(1)); in callback() 56 Promise<Integer> promise = new Promise<Integer>(); in multipleCallbacks() local 63 promise.then(callback); in multipleCallbacks() 64 promise.then(callback); in multipleCallbacks() 68 promise.fulfill(new Integer(0)); in multipleCallbacks() 72 /** Tests that a callback is called immediately when given to a fulfilled Promise. */ [all …]
|
/external/libchrome/base/android/java/src/org/chromium/base/ |
D | Promise.java | 16 * A Promise class to be used as a placeholder for a result that will be provided asynchronously. 18 * @param <T> The type the Promise will be fulfilled with. 20 public class Promise<T> { class 46 * A function class for use when chaining Promises with {@link Promise#then(Function)}. 55 * A function class for use when chaining Promises with {@link Promise#then(AsyncFunction)}. 60 Promise<R> apply(A argument); in apply() 64 * An exception class for when a rejected Promise is not handled and cannot pass the rejection 65 * to a subsequent Promise. 89 + "Promise.then(Callback) on a Promise that already has a rejection handler."; in then() 93 "Promise was rejected without a rejection handler.", reason); in then() [all …]
|
/external/kotlinx.coroutines/kotlinx-coroutines-core/wasmJs/src/ |
D | Promise.kt | 7 internal fun promiseSetDeferred(promise: Promise<JsAny?>, deferred: JsAny): Unit = in <lambda>() 8 js("promise.deferred = deferred") in <lambda>() 11 internal fun promiseGetDeferred(promise: Promise<JsAny?>): JsAny? = js("""{ in <lambda>() 12 …console.assert(promise instanceof Promise, "promiseGetDeferred must receive a promise, but got ", … in <lambda>() 13 return promise.deferred == null ? null : promise.deferred; in <lambda>() 18 * Starts new coroutine and returns its result as an implementation of [Promise]. in <lambda>() 32 public fun <T> CoroutineScope.promise( in <lambda>() method 36 ): Promise<JsAny?> = in <lambda>() 40 * Converts this deferred value to the instance of [Promise<JsAny?>]. in <lambda>() 42 public fun <T> Deferred<T>.asPromise(): Promise<JsAny?> { in <lambda>() [all …]
|
/external/kotlinx.coroutines/kotlinx-coroutines-core/js/test/ |
D | PromiseTest.kt | 9 fun testPromiseResolvedAsDeferred() = GlobalScope.promise { in <lambda>() 10 val promise = Promise<String> { resolve, _ -> in <lambda>() constant 13 val deferred = promise.asDeferred() in <lambda>() 18 fun testPromiseRejectedAsDeferred() = GlobalScope.promise { in <lambda>() 20 val promise = Promise<String> { _, reject -> in <lambda>() constant 23 val deferred = promise.asDeferred() in <lambda>() 24 // reject after converting to deferred to avoid "Unhandled promise rejection" warnings in <lambda>() 36 fun testCompletedDeferredAsPromise() = GlobalScope.promise { in <lambda>() 41 val promise = deferred.asPromise() in <lambda>() constant 42 assertEquals("OK", promise.await()) in <lambda>() [all …]
|
/external/kotlinx.coroutines/kotlinx-coroutines-core/wasmJs/test/ |
D | PromiseTest.kt | 9 fun testPromiseResolvedAsDeferred() = GlobalScope.promise { in <lambda>() 10 val promise = Promise<JsReference<String>> { resolve, _ -> in <lambda>() constant 13 val deferred = promise.asDeferred<JsReference<String>>() in <lambda>() 18 fun testPromiseRejectedAsDeferred() = GlobalScope.promise { in <lambda>() 20 val promise = Promise<JsAny?> { _, reject -> in <lambda>() constant 23 val deferred = promise.asDeferred<JsReference<String>>() in <lambda>() 24 // reject after converting to deferred to avoid "Unhandled promise rejection" warnings in <lambda>() 36 fun testCompletedDeferredAsPromise() = GlobalScope.promise { in <lambda>() 41 val promise = deferred.asPromise() in <lambda>() constant 42 assertEquals("OK", promise.await()) in <lambda>() [all …]
|
/external/aws-sdk-java-v2/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/ |
D | ProxyTunnelInitHandlerTest.java | 44 import io.netty.util.concurrent.Promise; 106 Promise<Channel> promise = GROUP.next().newPromise(); in successfulProxyResponse_completesFuture() local 107 …ProxyTunnelInitHandler handler = new ProxyTunnelInitHandler(mockChannelPool, REMOTE_HOST, promise); in successfulProxyResponse_completesFuture() 110 assertThat(promise.awaitUninterruptibly().getNow()).isEqualTo(mockChannel); in successfulProxyResponse_completesFuture() 117 Promise<Channel> promise = GROUP.next().newPromise(); in successfulProxyResponse_removesSelfAndCodec() local 118 …ProxyTunnelInitHandler handler = new ProxyTunnelInitHandler(mockChannelPool, REMOTE_HOST, promise); in successfulProxyResponse_removesSelfAndCodec() 129 Promise<Channel> promise = GROUP.next().newPromise(); in successfulProxyResponse_doesNotRemoveSslHandler() local 130 …ProxyTunnelInitHandler handler = new ProxyTunnelInitHandler(mockChannelPool, REMOTE_HOST, promise); in successfulProxyResponse_doesNotRemoveSslHandler() 139 Promise<Channel> promise = GROUP.next().newPromise(); in unexpectedMessage_failsPromise() local 140 …ProxyTunnelInitHandler handler = new ProxyTunnelInitHandler(mockChannelPool, REMOTE_HOST, promise); in unexpectedMessage_failsPromise() [all …]
|
/external/libcxx/test/std/thread/futures/futures.promise/ |
D | copy_ctor.fail.cpp | 14 // class promise<R> 16 // promise(const promise&) = delete; 26 std::promise<int> p0; in main() 27 … std::promise<int> p(p0); // expected-error {{call to deleted constructor of 'std::promise<int>'}} in main() 30 std::promise<int &> p0; in main() 31 …std::promise<int &> p(p0); // expected-error {{call to deleted constructor of 'std::promise<int &>… in main() 34 std::promise<void> p0; in main() 35 …std::promise<void> p(p0); // expected-error {{call to deleted constructor of 'std::promise<void>'}} in main() 39 std::promise<int> p0; in main() 40 …std::promise<int> p(p0); // expected-error {{calling a private constructor of class 'std::__1::pro… in main() [all …]
|
/external/federated-compute/fcp/base/ |
D | future.h | 19 * Promise<T> (allows providing the value for an associated future). 21 * These serve the same purpose as std::future and std::promise, but with a few 23 * - They do not represent exceptions (i.e. std::promise::set_exception). 26 * if the promise was 'abandoned'; this one indicates that with a value). 29 * - They are created as a pair (vs. std::promise::get_future(), which throws 31 * - Setting (promise) and taking (future) require rvalues (you might need to 54 // Since fcp::Promise is already defined by the reactive streams library 55 // (fcp/reactive/), we'll define fcp::thread::{Promise, Future}. 62 class Promise; variable 66 Promise<T> promise; member [all …]
|
D | future_test.cc | 42 // "probably" has time to block). Note that the other ordering (Promise::Set 52 // Move-only test value (we use this for Promise and Future, to make sure they 74 void SetV(Promise<UV> promise) { std::move(promise).Set(UV(Unit{})); } in SetV() argument 89 void RunThreadsWithFuture(std::function<void(Promise<UV>)> promise_fn, in RunThreadsWithFuture() 93 MoveToLambdaWrapper<Promise<UV>> promise_capture = in RunThreadsWithFuture() 94 MoveToLambda(std::move(pair.promise)); in RunThreadsWithFuture() 112 auto promise_fn = [&](Promise<UV> promise) { in TEST() argument 114 SetV(std::move(promise)); in TEST() 135 auto promise_fn = [&](Promise<UV> promise) { in TEST() argument 136 SetV(std::move(promise)); in TEST() [all …]
|
/external/cronet/tot/base/test/android/javatests/src/org/chromium/base/test/util/ |
D | Matchers.java | 14 import org.chromium.base.Promise; 47 * @param <T> The type of the {@link Promise} to match. 48 * @return A matcher that expects {@link Promise#isPending()} to be true. 50 public static <T> Matcher<Promise<T>> pendingPromise() { in pendingPromise() 55 * @param <T> The type of the {@link Promise} to match. 56 * @return A matcher that expects {@link Promise#isRejected()} to be true. 58 public static <T> Matcher<Promise<T>> rejectedPromise() { in rejectedPromise() 63 * @param <T> The type of the {@link Promise} to match. 64 * @return A matcher that expects {@link Promise#isFulfilled()} to be true. 66 public static <T> Matcher<Promise<T>> fulfilledPromise() { in fulfilledPromise() [all …]
|
/external/cronet/stable/base/test/android/javatests/src/org/chromium/base/test/util/ |
D | Matchers.java | 14 import org.chromium.base.Promise; 47 * @param <T> The type of the {@link Promise} to match. 48 * @return A matcher that expects {@link Promise#isPending()} to be true. 50 public static <T> Matcher<Promise<T>> pendingPromise() { in pendingPromise() 55 * @param <T> The type of the {@link Promise} to match. 56 * @return A matcher that expects {@link Promise#isRejected()} to be true. 58 public static <T> Matcher<Promise<T>> rejectedPromise() { in rejectedPromise() 63 * @param <T> The type of the {@link Promise} to match. 64 * @return A matcher that expects {@link Promise#isFulfilled()} to be true. 66 public static <T> Matcher<Promise<T>> fulfilledPromise() { in fulfilledPromise() [all …]
|
/external/rust/android-crates-io/crates/grpcio-sys/grpc/src/core/lib/promise/ |
D | prioritized_race.h | 36 // Check the priority promise. in operator() 39 // Check the other promise. in operator() 60 template <typename Promise, typename... Promises> 61 class PrioritizedRace<Promise, Promises...> 62 : public TwoPartyPrioritizedRace<Promise, PrioritizedRace<Promises...>> { 64 using Result = decltype(std::declval<Promise>()()); 65 explicit PrioritizedRace(Promise promise, Promises... promises) in PrioritizedRace() argument 66 : TwoPartyPrioritizedRace<Promise, PrioritizedRace<Promises...>>( in PrioritizedRace() 67 std::move(promise), in PrioritizedRace() 71 template <typename Promise> [all …]
|
D | map.h | 26 #include "src/core/lib/promise/detail/promise_like.h" 27 #include "src/core/lib/promise/poll.h" 34 // Promise is the type of promise to poll on, Fn is a function that takes the 35 // result of Promise and maps it to some new type. 36 template <typename Promise, typename Fn> 39 Map(Promise promise, Fn fn) in Map() argument 40 : promise_(std::move(promise)), fn_(std::move(fn)) {} in Map() 49 using PromiseResult = typename PromiseLike<Promise>::Result; 62 PromiseLike<Promise> promise_; 69 // Takes a promise, and a synchronous function to mutate its result, and [all …]
|
D | if.h | 28 #include "src/core/lib/promise/detail/promise_factory.h" 29 #include "src/core/lib/promise/detail/promise_like.h" 30 #include "src/core/lib/promise/poll.h" 40 auto promise = if_true->Make(); in ChooseIf() local 41 return call_poll(promise); in ChooseIf() 43 auto promise = if_false->Make(); in ChooseIf() local 44 return call_poll(promise); in ChooseIf() 55 auto promise = if_true->Make(); in ChooseIf() local 56 return call_poll(promise); in ChooseIf() 58 auto promise = if_false->Make(); in ChooseIf() local [all …]
|
D | race.h | 31 template <typename Promise, typename... Promises> 32 class Race<Promise, Promises...> { 34 using Result = decltype(std::declval<Promise>()()); 36 explicit Race(Promise promise, Promises... promises) in Race() argument 37 : promise_(std::move(promise)), next_(std::move(promises)...) {} in Race() 40 // Check our own promise. in operator() 51 // The Promise checked by this instance. 52 Promise promise_; 57 template <typename Promise> 58 class Race<Promise> { [all …]
|
/external/grpc-grpc/src/core/lib/promise/ |
D | prioritized_race.h | 35 // Check the priority promise. in operator() 38 // Check the other promise. in operator() 59 template <typename Promise, typename... Promises> 60 class PrioritizedRace<Promise, Promises...> 61 : public TwoPartyPrioritizedRace<Promise, PrioritizedRace<Promises...>> { 63 using Result = decltype(std::declval<Promise>()()); 64 explicit PrioritizedRace(Promise promise, Promises... promises) in PrioritizedRace() argument 65 : TwoPartyPrioritizedRace<Promise, PrioritizedRace<Promises...>>( in PrioritizedRace() 66 std::move(promise), in PrioritizedRace() 70 template <typename Promise> [all …]
|
D | if.h | 27 #include "src/core/lib/promise/detail/promise_factory.h" 28 #include "src/core/lib/promise/detail/promise_like.h" 29 #include "src/core/lib/promise/poll.h" 39 auto promise = if_true->Make(); in ChooseIf() local 40 return call_poll(promise); in ChooseIf() 42 auto promise = if_false->Make(); in ChooseIf() local 43 return call_poll(promise); in ChooseIf() 54 auto promise = if_true->Make(); in ChooseIf() local 55 return call_poll(promise); in ChooseIf() 57 auto promise = if_false->Make(); in ChooseIf() local [all …]
|
D | map.h | 25 #include "src/core/lib/promise/detail/promise_like.h" 26 #include "src/core/lib/promise/poll.h" 33 // Promise is the type of promise to poll on, Fn is a function that takes the 34 // result of Promise and maps it to some new type. 35 template <typename Promise, typename Fn> 38 Map(Promise promise, Fn fn) in Map() argument 39 : promise_(std::move(promise)), fn_(std::move(fn)) {} in Map() 48 using PromiseResult = typename PromiseLike<Promise>::Result; 61 PromiseLike<Promise> promise_; 68 // Takes a promise, and a synchronous function to mutate its result, and [all …]
|
D | race.h | 30 template <typename Promise, typename... Promises> 31 class Race<Promise, Promises...> { 33 using Result = decltype(std::declval<Promise>()()); 35 explicit Race(Promise promise, Promises... promises) in Race() argument 36 : promise_(std::move(promise)), next_(std::move(promises)...) {} in Race() 39 // Check our own promise. in operator() 50 // The Promise checked by this instance. 51 Promise promise_; 56 template <typename Promise> 57 class Race<Promise> { [all …]
|
/external/aws-sdk-java-v2/http-clients/netty-nio-client/src/main/java/software/amazon/awssdk/http/nio/netty/internal/utils/ |
D | BetterFixedChannelPool.java | 27 import io.netty.util.concurrent.Promise; 110 // Fail the promise as we timed out. in BetterFixedChannelPool() 111 task.promise.setFailure(TIMEOUT_EXCEPTION); in BetterFixedChannelPool() 123 delegateChannelPool.acquire(task.promise); in BetterFixedChannelPool() 141 public Future<Channel> acquire(final Promise<Channel> promise) { in acquire() argument 144 acquire0(promise); in acquire() 146 executor.execute(() -> acquire0(promise)); in acquire() 149 promise.setFailure(cause); in acquire() 151 return promise; in acquire() 171 private void acquire0(final Promise<Channel> promise) { in acquire0() argument [all …]
|
/external/rust/android-crates-io/crates/grpcio-sys/grpc/src/core/lib/promise/detail/ |
D | basic_seq.h | 30 #include "src/core/lib/promise/detail/promise_factory.h" 31 #include "src/core/lib/promise/detail/promise_like.h" 32 #include "src/core/lib/promise/detail/switch.h" 33 #include "src/core/lib/promise/poll.h" 42 // Our current promise. 43 using Promise = FPromise; member 44 // The result of our current promise. 45 using PromiseResult = typename Promise::Result; 46 // Traits around the result of our promise. 56 // A state contains the current promise, and the promise factory to turn the [all …]
|