Home
last modified time | relevance | path

Searched full:promise (Results 1 – 25 of 1493) sorted by relevance

12345678910>>...60

/external/cronet/base/android/java/src/org/chromium/base/
DPromise.java18 * 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/base/android/junit/src/org/chromium/base/
DPromiseTest.java18 import org.chromium.base.Promise.UnhandledRejectionException;
23 /** Unit tests for {@link Promise}. */
46 Promise<Integer> promise = new Promise<>(); in callback() local
47 promise.then(PromiseTest.setValue(value, 1)); in callback()
51 promise.fulfill(1); in callback()
60 Promise<Integer> promise = new Promise<>(); in multipleCallbacks() local
65 promise.then(callback); in multipleCallbacks()
66 promise.then(callback); in multipleCallbacks()
70 promise.fulfill(0); in multipleCallbacks()
74 /** Tests that a callback is called immediately when given to a fulfilled Promise. */
[all …]
/external/libchrome/base/android/junit/src/org/chromium/base/
DPromiseTest.java17 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/
DPromise.java16 * 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/aws-sdk-java-v2/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/
DProxyTunnelInitHandlerTest.java44 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/
Dcopy_ctor.fail.cpp14 // 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/kotlinx.coroutines/kotlinx-coroutines-core/js/test/
DPromiseTest.kt12 fun testPromiseResolvedAsDeferred() = GlobalScope.promise { in <lambda>()
13 val promise = Promise<String> { resolve, _ -> in <lambda>() constant
16 val deferred = promise.asDeferred() in <lambda>()
21 fun testPromiseRejectedAsDeferred() = GlobalScope.promise { in <lambda>()
23 val promise = Promise<String> { _, reject -> in <lambda>() constant
26 val deferred = promise.asDeferred() in <lambda>()
27 // reject after converting to deferred to avoid "Unhandled promise rejection" warnings in <lambda>()
39 fun testCompletedDeferredAsPromise() = GlobalScope.promise { in <lambda>()
44 val promise = deferred.asPromise() in <lambda>() constant
45 assertEquals("OK", promise.await()) in <lambda>()
[all …]
/external/federated-compute/fcp/base/
Dfuture.h19 * 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 …]
Dfuture_test.cc42 // "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/perfetto/ui/src/controller/
Dadb_interfaces.ts16 connect(device: USBDevice): Promise<void>;
17 disconnect(): Promise<void>;
19 shell(cmd: string): Promise<AdbStream>;
21 shellOutputAsString(cmd: string): Promise<string>;
23 socket(path: string): Promise<AdbStream>;
27 write(msg: string | Uint8Array): Promise<void>;
38 connect(_: USBDevice): Promise<void> {
39 return Promise.resolve();
42 disconnect(): Promise<void> {
43 return Promise.resolve();
[all …]
/external/grpc-grpc/src/core/lib/promise/
Dif.h27 #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 …]
Dprioritized_race.h35 // 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 …]
Dmap.h25 #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 …]
Drace.h30 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 …]
Dpromise.h26 #include "src/core/lib/promise/detail/promise_like.h"
27 #include "src/core/lib/promise/poll.h"
31 // A Promise is any functor that takes no arguments and returns Poll<T>.
35 using Promise = absl::AnyInvocable<Poll<T>()>; variable
37 // Helper to execute a promise immediately and return either the result or
39 template <typename Promise>
40 auto NowOrNever(Promise promise)
41 -> absl::optional<typename promise_detail::PromiseLike<Promise>::Result> {
42 auto r = promise_detail::PromiseLike<Promise>(std::move(promise))();
49 // A promise that never completes.
[all …]
/external/rust/crates/grpcio-sys/grpc/src/core/lib/promise/
Dprioritized_race.h36 // 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 …]
Dmap.h26 #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 …]
Dif.h28 #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 …]
Drace.h31 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/aws-sdk-java-v2/http-clients/netty-nio-client/src/main/java/software/amazon/awssdk/http/nio/netty/internal/utils/
DBetterFixedChannelPool.java27 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 …]
DNettyUtils.java31 import io.netty.util.concurrent.Promise;
166 …* Creates a {@link BiConsumer} that notifies the promise of any failures either via the {@link Thr…
169 …n Function called to process the successful result and map it into the result to notify the promise
171 * @param promise Promise to notify of success or failure.
173 * @param <PromiseT> Type being fulfilled by the promise.
177 Function<SuccessT, PromiseT> successFunction, Promise<PromiseT> promise) { in promiseNotifyingBiConsumer() argument
180 promise.setFailure(fail); in promiseNotifyingBiConsumer()
183 promise.setSuccess(successFunction.apply(success)); in promiseNotifyingBiConsumer()
185 promise.setFailure(e); in promiseNotifyingBiConsumer()
192 …* Creates a {@link BiConsumer} that notifies the promise of any failures either via the throwable …
[all …]
/external/rust/crates/grpcio-sys/grpc/src/core/lib/promise/detail/
Dbasic_seq.h30 #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 …]
/external/libcxx/include/
Dfuture59 class promise
62 promise();
64 promise(allocator_arg_t, const Allocator& a);
65 promise(promise&& rhs) noexcept;
66 promise(const promise& rhs) = delete;
67 ~promise();
70 promise& operator=(promise&& rhs) noexcept;
71 promise& operator=(const promise& rhs) = delete;
72 void swap(promise& other) noexcept;
89 class promise<R&>
[all …]
/external/grpc-grpc-java/netty/src/main/java/io/grpc/netty/
DWriteQueue.java82 Preconditions.checkArgument(command.promise() == null, "promise must not be set on command"); in enqueue()
84 ChannelPromise promise = channel.newPromise(); in enqueue() local
85 command.promise(promise); in enqueue()
90 return promise; in enqueue()
165 public final void promise(ChannelPromise promise) { in promise() method in WriteQueue.RunnableCommand
170 public final ChannelPromise promise() { in promise() method in WriteQueue.RunnableCommand
187 private ChannelPromise promise; field in WriteQueue.AbstractQueuedCommand
195 public final void promise(ChannelPromise promise) { in promise() argument
196 this.promise = promise; in promise()
200 public final ChannelPromise promise() { in promise() method in WriteQueue.AbstractQueuedCommand
[all …]
/external/grpc-grpc/src/core/lib/promise/detail/
Dpromise_factory.h26 #include "src/core/lib/promise/detail/promise_like.h"
30 // Where a Promise is a thing that's polled periodically, a PromiseFactory
31 // creates a Promise. Within this Promise/Activity framework, PromiseFactory's
35 // A PromiseFactory formally is f(A) -> Promise<T> for some types A & T.
38 // Of course a callable of a single argument returning a Promise will see an
39 // identity translation. One taking no arguments and returning a Promise
42 // A Promise passed to a PromiseFactory will yield a PromiseFactory that
43 // returns just that Promise.
96 // Captures the promise functor and the argument passed.
97 // Provides the interface of a promise.
[all …]

12345678910>>...60