multithreading - Asynchronous REST API with Jersey -
we using jersey rest webservice (deployed on tomcat).
i know
- tomcat's http connector has thread pool reading http requests , forwarding jersey.
- forwarding jersey synchronous.
i read here jersey provides asyncservice
maximise concurrency.
question: why jersey's async design force developer offload rest processing separate thread/runnable, while jersey can dedicated/private executor pool?
is better control developer or missing here?
why jersey's async design force developer offload rest processing separate thread/runnable, while jersey can dedicated/private executor pool?
you're not forced to. jersey has @managedasync
can put on methods. asking
managedasync
indicates resource method annotation has been applied should executed on separate thread managed internal jersey executor service.
@get @managedasync public void longget(@suspended final asyncresponse ar) { }
see also:
great
ReplyDelete