When to use Spring @Async vs Callable controller (async controller, servlet 3)

前端 未结 2 796
醉梦人生
醉梦人生 2020-12-05 00:40

I would like to know the general use case of using @Async and Servlet 3 asynchronous request implementation in Spring using Callable.

As I understand, @Async is for

2条回答
  •  温柔的废话
    2020-12-05 01:19

    you can not improve single request performance with using Callable interface, it helps to take more request in some cases. If your response type would be void, you can use runnable instead of callable, so with using runnable you can improve single request response time.

提交回复
热议问题