Package | Description |
---|---|
ratpack.exec |
The execution management.
|
ratpack.handling |
The handling of application requests.
|
ratpack.http.client | |
ratpack.rx |
Provides integration with the RxJava library.
|
ratpack.stream | |
ratpack.test.exec |
Modifier and Type | Method and Description |
---|---|
<T> Promise<T> |
ExecControl.blocking(Callable<T> blockingOperation)
Performs a blocking operation on a separate thread, returning a promise for its value.
|
<O> Promise<O> |
PromiseOperations.blockingMap(Function<? super T,? extends O> transformer)
Like
PromiseOperations.map(Function) , but performs the transformation on a blocking thread. |
Promise<T> |
PromiseOperations.cache()
Caches the promised value (or error) and returns it to all subscribers.
|
Promise<T> |
PromiseOperations.defer(Action<? super Runnable> releaser)
Allows the execution of the promise to be deferred to a later time.
|
<O> Promise<O> |
PromiseOperations.flatMap(Function<? super T,? extends Promise<O>> transformer)
Transforms the promised value by applying the given function to it that returns a promise for the transformed value.
|
<O> Promise<O> |
PromiseOperations.map(Function<? super T,? extends O> transformer)
Transforms the promised value by applying the given function to it.
|
Promise<T> |
PromiseOperations.onNull(NoArgAction action)
A convenience shorthand for
routing null values. |
Promise<T> |
PromiseOperations.onYield(Runnable onYield)
Registers a listener that is invoked when
this promise is initiated. |
<T> Promise<T> |
ExecControl.promise(Action<? super Fulfiller<T>> action)
Creates a promise for an asynchronously created value.
|
Promise<T> |
PromiseOperations.route(Predicate<? super T> predicate,
Action<? super T> action)
Allows the promised value to be handled specially if it meets the given predicate, instead of being handled by the promise subscriber.
|
<T> Promise<T> |
Throttle.throttle(Promise<T> promise)
Throttles the given promise.
|
Promise<T> |
PromiseOperations.throttled(Throttle throttle)
Throttles
this promise, using the given throttle . |
Promise<T> |
PromiseOperations.wiretap(Action<? super Result<T>> listener)
Registers a listener for the promise outcome.
|
Modifier and Type | Method and Description |
---|---|
<T> Promise<T> |
Throttle.throttle(Promise<T> promise)
Throttles the given promise.
|
Modifier and Type | Method and Description |
---|---|
<O> Promise<O> |
PromiseOperations.flatMap(Function<? super T,? extends Promise<O>> transformer)
Transforms the promised value by applying the given function to it that returns a promise for the transformed value.
|
Modifier and Type | Method and Description |
---|---|
<T> Promise<T> |
Context.blocking(Callable<T> blockingOperation)
Executes a blocking operation, returning a promise for its result.
|
<T> Promise<T> |
Context.promise(Action<? super Fulfiller<T>> action)
Creates a promise of a value that will made available asynchronously.
|
Modifier and Type | Method and Description |
---|---|
default Promise<ReceivedResponse> |
HttpClient.get(URI uri) |
Promise<ReceivedResponse> |
HttpClient.get(URI uri,
Action<? super RequestSpec> action)
An asynchronous method to do a GET HTTP request, the URL and all details of the request are configured by the Action acting on the RequestSpec, but the method will be defaulted to a GET.
|
Promise<ReceivedResponse> |
HttpClient.post(URI uri,
Action<? super RequestSpec> action)
An asynchronous method to do a POST HTTP request, the URL and all details of the request are configured by the Action acting on the RequestSpec, but the method will be defaulted to a POST.
|
Promise<ReceivedResponse> |
HttpClient.request(URI uri,
Action<? super RequestSpec> action)
An asynchronous method to do a HTTP request, the URL and all details of the request are configured by the Action acting on the RequestSpec.
|
Modifier and Type | Method and Description |
---|---|
static <T> Promise<List<T>> |
RxRatpack.asPromise(Observable<T> observable)
Converts a Rx
Observable into a Ratpack Promise . |
static <T> Promise<T> |
RxRatpack.asPromiseSingle(Observable<T> observable)
Convenience for converting an
Observable to a Promise when it is known that the observable sequence is of zero or one elements. |
Modifier and Type | Method and Description |
---|---|
static <T> Observable<T> |
RxRatpack.observe(Promise<T> promise)
Converts a Ratpack promise into an Rx observable.
|
static <T,I extends Iterable<T>> |
RxRatpack.observeEach(Promise<I> promise)
Converts a Ratpack promise of an iterable value into an Rx observable for each element of the promised iterable.
|
Modifier and Type | Method and Description |
---|---|
static <I,O> org.reactivestreams.Publisher<O> |
Streams.flatMap(org.reactivestreams.Publisher<I> input,
Function<? super I,? extends Promise<? extends O>> function)
Returns a publisher that publishes items from the given input publisher after transforming each item via the given, promise returning, function.
|
Modifier and Type | Method and Description |
---|---|
default <T> Promise<T> |
ExecHarness.blocking(Callable<T> blockingOperation)
Performs a blocking operation on a separate thread, returning a promise for its value.
|
default <T> Promise<T> |
ExecHarness.promise(Action<? super Fulfiller<T>> action)
Creates a promise for an asynchronously created value.
|
Modifier and Type | Method and Description |
---|---|
<T> ExecResult<T> |
ExecHarness.yield(Function<ExecControl,Promise<T>> func)
Synchronously returns a promised value.
|
static <T> ExecResult<T> |
ExecHarness.yieldSingle(Function<ExecControl,Promise<T>> func)
Creates an exec harness,
executes the given function with it before closing it, then returning execution result. |