Convert scala future to java future

后端 未结 3 2267
迷失自我
迷失自我 2021-02-19 09:18

I have a generated java interface containing a method:

public Future getCustomersAsync(AsyncHandler asyncHandler);

I w

3条回答
  •  悲哀的现实
    2021-02-19 10:05

    I don't think that there is a easy way to convert scala Future to java Future. One possible solution is to wrap scala future by java future but you must pass a new task to the thread pool, see java docs: http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Future.html

提交回复
热议问题