public class AsyncRequest<R,V> extends Object
Constructor and Description |
---|
AsyncRequest(Fiber target) |
Modifier and Type | Method and Description |
---|---|
Disposable |
publish(RequestChannel<R,V> channel,
R req,
Callback<List<V>> onResponse) |
AsyncRequest<R,V> |
setResponseCount(int responses) |
AsyncRequest<R,V> |
setTimeout(Callback<List<V>> onTimeout,
long time,
TimeUnit unit) |
static <R,V> Disposable |
withOneReply(Fiber fiber,
RequestChannel<R,V> channel,
R req,
Callback<V> onReply) |
static <R,V> Disposable |
withOneReply(Fiber fiber,
RequestChannel<R,V> channel,
R req,
Callback<V> onReply,
long timeout,
TimeUnit unit,
Runnable onTimeout) |
public AsyncRequest(Fiber target)
public AsyncRequest<R,V> setTimeout(Callback<List<V>> onTimeout, long time, TimeUnit unit)
public AsyncRequest<R,V> setResponseCount(int responses)
responses
- - number of expected responses or 0 if using a timeout to gather responses.public Disposable publish(RequestChannel<R,V> channel, R req, Callback<List<V>> onResponse)
public static <R,V> Disposable withOneReply(Fiber fiber, RequestChannel<R,V> channel, R req, Callback<V> onReply)
public static <R,V> Disposable withOneReply(Fiber fiber, RequestChannel<R,V> channel, R req, Callback<V> onReply, long timeout, TimeUnit unit, Runnable onTimeout)
Copyright © 2017. All Rights Reserved.