为您找到"
Vertx - Future.compose
"相关结果约100,000,000个
Compose this future with a successMapper and failureMapper functions. When this future (the one on which compose is called) succeeds, the successMapper will be called with the completed value and this mapper returns another future object. This returned future completion will complete the future returned by this method call.
The Future object implements some interesting patterns that smartly help resolving async issues: Map; Compose; Recover; Future Mapping For those of you who know about the map function, part of the java Stream API, this feature should be immediate to understand. The Future's map function accepts a function that transforms the result from one ...
Future.compose() example. Note: if the first future fails, the whole future sequence fails, and the handler is skipped. ... Vertx. Asynchronous Programming. Java. Computer Science. Concurrency ...
Pay attention to the colors. Judging just by the result types, you could assume that compose() would return the nested Future, while Map would return the same object it received. This is incorrect. Both compose() and map() return a new Future.. But compose wraps the actual value into a Future, while Map wraps the underlying Future into a new one.
The great advantage of using Future is the ability to chain them using Future.compose(). First, let's translate standard Vertx methods, which receive callbacks to methods and returns Future. We ...
Compose this future with a successMapper and failureMapper functions. When this future (the one on which compose is called) succeeds, the successMapper will be called with the completed value and this mapper returns another future object. This returned future completion will complete the future returned by this method call.
Clarity over the question would be really helpful here, because some how you have defined step_1() as returning void but you are showing as if you are getting Future from it, you intentions are clear that you want step1 execution and then execute step2, are they inherently blocking and is that the reason you want to have worker verticle.Please clarify so that we can all you better.
The composite future wraps a list of futures, it is useful when several futures needs to be coordinated.The handlers set for the coordinated futures are overridden by the handler of the composite future.
Introduction In this page you can find the example usage for io.vertx.core Future compose. Prototype default Future compose(Function> mapper ...
Compose this future with a provided next future.. When this (the one on which compose is called) future succeeds, the handler will be called with the completed value, this handler should complete the next future.. If the handler throws an exception, the returned future will be failed with this exception.. When this future fails, the failure will be propagated to the next future and the handler ...