/** * Return a new {@link DeferredPromiseImpl} using the {@link PromiseFactory} * of this PromiseImpl. * * @return A new DeferredPromiseImpl. * @since 1.1 */ <V> DeferredPromiseImpl<V> deferred() { return new DeferredPromiseImpl<>(factory); }
/** * Create a new Deferred with the specified callback and scheduled * executors. * * @param factory The factory to use for callbacks and scheduled operations. * @since 1.1 */ Deferred(PromiseFactory factory) { promise = new DeferredPromiseImpl<>(factory); }
/** * Create a new Deferred with the specified callback and scheduled * executors. * * @param factory The factory to use for callbacks and scheduled operations. * @since 1.1 */ Deferred(PromiseFactory factory) { promise = new DeferredPromiseImpl<>(factory); }
/** * Create a new Deferred with the specified callback and scheduled * executors. * * @param factory The factory to use for callbacks and scheduled operations. * @since 1.1 */ Deferred(PromiseFactory factory) { promise = new DeferredPromiseImpl<>(factory); }
/** * Return a new {@link DeferredPromiseImpl} using the {@link PromiseFactory} * of this PromiseImpl. * * @return A new DeferredPromiseImpl. * @since 1.1 */ <V> DeferredPromiseImpl<V> deferred() { return new DeferredPromiseImpl<>(factory); }
/** * Return a new {@link DeferredPromiseImpl} using the {@link PromiseFactory} * of this PromiseImpl. * * @return A new DeferredPromiseImpl. * @since 1.1 */ <V> DeferredPromiseImpl<V> deferred() { return new DeferredPromiseImpl<>(factory); }
/** * Return a new {@link DeferredPromiseImpl} using the {@link PromiseFactory} * of this PromiseImpl. * * @return A new DeferredPromiseImpl. * @since 1.1 */ <V> DeferredPromiseImpl<V> deferred() { return new DeferredPromiseImpl<>(factory); }
/** * Create a new Deferred with the specified callback and scheduled * executors. * * @param factory The factory to use for callbacks and scheduled operations. * @since 1.1 */ Deferred(PromiseFactory factory) { promise = new DeferredPromiseImpl<>(factory); }
/** * Create a new Deferred with the specified callback and scheduled * executors. * * @param factory The factory to use for callbacks and scheduled operations. * @since 1.1 */ Deferred(PromiseFactory factory) { promise = new DeferredPromiseImpl<>(factory); }
/** * Create a new Deferred with the specified callback and scheduled * executors. * * @param factory The factory to use for callbacks and scheduled operations. * @since 1.1 */ Deferred(PromiseFactory factory) { promise = new DeferredPromiseImpl<>(factory); }
/** * Return a new {@link DeferredPromiseImpl} using the {@link PromiseFactory} * of this PromiseImpl. * * @return A new DeferredPromiseImpl. * @since 1.1 */ <V> DeferredPromiseImpl<V> deferred() { return new DeferredPromiseImpl<>(factory); }
/** * Return a new {@link DeferredPromiseImpl} using the {@link PromiseFactory} * of this PromiseImpl. * * @return A new DeferredPromiseImpl. * @since 1.1 */ <V> DeferredPromiseImpl<V> deferred() { return new DeferredPromiseImpl<>(factory); }
/** * Create a new Deferred with the specified callback and scheduled * executors. * * @param factory The factory to use for callbacks and scheduled operations. * @since 1.1 */ Deferred(PromiseFactory factory) { promise = new DeferredPromiseImpl<>(factory); }
/** * Return a new {@link DeferredPromiseImpl} using the {@link PromiseFactory} * of this PromiseImpl. * * @return A new DeferredPromiseImpl. * @since 1.1 */ <V> DeferredPromiseImpl<V> deferred() { return new DeferredPromiseImpl<>(factory); }
/** * Returns a new Promise that will hold the result of the specified task. * <p> * The returned Promise uses the callback executor and scheduled executor of * this PromiseFactory object * <p> * The specified task will be executed on the {@link #executor() callback * executor}. * * @param <T> The value type associated with the returned Promise. * @param task The task whose result will be available from the returned * Promise. * @return A new Promise that will hold the result of the specified task. */ public <T> Promise<T> submit(Callable< ? extends T> task) { DeferredPromiseImpl<T> promise = new DeferredPromiseImpl<>(this); Runnable submit = promise.new Submit(task); try { executor().execute(submit); } catch (Exception t) { promise.tryResolve(null, t); } return promise.orDone(); }
/** * Returns a new Promise that will hold the result of the specified task. * <p> * The returned Promise uses the callback executor and scheduled executor of * this PromiseFactory object. * <p> * The specified task will be executed on the {@link #executor() callback * executor}. * * @param <T> The value type associated with the returned Promise. * @param task The task whose result will be available from the returned * Promise. * @return A new Promise that will hold the result of the specified task. */ public <T> Promise<T> submit(Callable< ? extends T> task) { DeferredPromiseImpl<T> promise = new DeferredPromiseImpl<>(this); Runnable submit = promise.new Submit(task); try { executor().execute(submit); } catch (Exception t) { promise.tryResolve(null, t); } return promise.orDone(); }
/** * Returns a new Promise that will hold the result of the specified task. * <p> * The returned Promise uses the callback executor and scheduled executor of * this PromiseFactory object. * <p> * The specified task will be executed on the {@link #executor() callback * executor}. * * @param <T> The value type associated with the returned Promise. * @param task The task whose result will be available from the returned * Promise. * @return A new Promise that will hold the result of the specified task. */ public <T> Promise<T> submit(Callable< ? extends T> task) { DeferredPromiseImpl<T> promise = new DeferredPromiseImpl<>(this); Runnable submit = promise.new Submit(task); try { executor().execute(submit); } catch (Exception t) { promise.tryResolve(null, t); } return promise.orDone(); }
/** * Returns a new Promise that will hold the result of the specified task. * <p> * The returned Promise uses the callback executor and scheduled executor of * this PromiseFactory object. * <p> * The specified task will be executed on the {@link #executor() callback * executor}. * * @param <T> The value type associated with the returned Promise. * @param task The task whose result will be available from the returned * Promise. * @return A new Promise that will hold the result of the specified task. */ public <T> Promise<T> submit(Callable< ? extends T> task) { DeferredPromiseImpl<T> promise = new DeferredPromiseImpl<>(this); Runnable submit = promise.new Submit(task); try { executor().execute(submit); } catch (Exception t) { promise.tryResolve(null, t); } return promise.orDone(); }
/** * Returns a new Promise that will hold the result of the specified task. * <p> * The returned Promise uses the callback executor and scheduled executor of * this PromiseFactory object. * <p> * The specified task will be executed on the {@link #executor() callback * executor}. * * @param <T> The value type associated with the returned Promise. * @param task The task whose result will be available from the returned * Promise. * @return A new Promise that will hold the result of the specified task. */ public <T> Promise<T> submit(Callable< ? extends T> task) { DeferredPromiseImpl<T> promise = new DeferredPromiseImpl<>(this); Runnable submit = promise.new Submit(task); try { executor().execute(submit); } catch (Exception t) { promise.tryResolve(null, t); } return promise.orDone(); }
/** * Returns a new Promise that will hold the result of the specified task. * <p> * The returned Promise uses the callback executor and scheduled executor of * this PromiseFactory object * <p> * The specified task will be executed on the {@link #executor() callback * executor}. * * @param <T> The value type associated with the returned Promise. * @param task The task whose result will be available from the returned * Promise. * @return A new Promise that will hold the result of the specified task. */ public <T> Promise<T> submit(Callable< ? extends T> task) { DeferredPromiseImpl<T> promise = new DeferredPromiseImpl<>(this); Runnable submit = promise.new Submit(task); try { executor().execute(submit); } catch (Exception t) { promise.tryResolve(null, t); } return promise.orDone(); }