Skip to content

Instantly share code, notes, and snippets.

@haigopi
Last active July 15, 2018 22:41
Show Gist options
  • Save haigopi/9c7163c1407cfe7eaaa4b28b4f7a06ea to your computer and use it in GitHub Desktop.
Save haigopi/9c7163c1407cfe7eaaa4b28b4f7a06ea to your computer and use it in GitHub Desktop.
public void initiateOutboundSyncReactor(ConcurrentLinkedQueue<Tuple3<String, String, HttpMethod>> q) {
simpleReact.
from(q.stream().map(it -> syncMaker.call(q.poll()))).
then(resp -> syncMaker.handleSyncResponse(resp)).
onFail(e -> syncMaker.handleError(e, e.getValue()));
}
public void initiateOutboundAsyncReactor(ConcurrentLinkedQueue<Tuple3<String, String, HttpMethod>> q) {
simpleReact.
fromStream(q.stream().map(it -> FutureConverter.toCompletableFuture(asyncMaker.call(q.peek())))).
then(resp -> asyncMaker.handleAsyncResponse(resp)).
onFail(e -> asyncMaker.handleError(e, e.getValue()));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment