It looks like it should be pretty simple⦠Promise<Response> myPromise = getPromise();
myPromise.onSuccess(listener::onResponse) .onFailure(listener::onFailure); Best Regards, Tim > On 19 Sep 2018, at 15:16, Alain Picard via osgi-dev <osgi-dev@mail.osgi.org> > wrote: > > We are using ElasticSearch which provide an async mode that is heavily based > on promises, They even provide BiConsumer to integrate with CompletableFuture. > > The interface is ActionListener > (https://github.com/elastic/elasticsearch/blob/master/server/src/main/java/org/elasticsearch/action/ActionListener.java > > <https://github.com/elastic/elasticsearch/blob/master/server/src/main/java/org/elasticsearch/action/ActionListener.java>). > > What is the best way to tie this is to promises instead, so that we don't > have to deal with different mode of handling asynchronous processing, and we > are also envisioning the possibility of integrating push streams here as well. > > Thanks > Alain > > _______________________________________________ > OSGi Developer Mail List > osgi-dev@mail.osgi.org > https://mail.osgi.org/mailman/listinfo/osgi-dev
_______________________________________________ OSGi Developer Mail List osgi-dev@mail.osgi.org https://mail.osgi.org/mailman/listinfo/osgi-dev