首页 > 解决方案 > JerseyClient 如何处理异步回调?

问题描述

我了解如何在泽西岛制作 InvocationCallback。但我无法获得 Jersey 使用哪个线程来处理这些回调请求。

它是每次使用 Executor Service 创建一个新线程还是使用一个池?

我正在研究泽西岛的文档

https://eclipse-ee4j.github.io/jersey.github.io/documentation/latest/async.html 并浏览了一些文档

https://eclipse-ee4j.github.io/jersey.github.io/apidocs/snapshot/jersey/org/glassfish/jersey/client/ClientProperties.html#ASYNC_THREADPOOL_SIZE

如果我传递了 Async_thread_pool_size 那么这个池是否也会用于回调?

谢谢

标签: javajerseyjersey-clientasynccallback

解决方案


线程池是基于传递的线程池属性创建的,或者每次创建一个新线程 Jersey InvocationCallback Completed: 哪个线程用于调用这些方法


推荐阅读