Is the Jetty example available somewhere?
Alan Bateman
Alan.Bateman at oracle.com
Sun Sep 1 07:51:29 UTC 2019
On 29/08/2019 06:32, Billy Sjöberg wrote:
> I’ve seen Alan showing the very interesting graphs comparing a regular blocking http server versus one where the threadpool is configured to use fibers.
> Is there a repo somewhere where this code is available? Or perhaps some sample on how to configure Jetty?
> I’ve tried reproducing it myself, but are stumbling on how to set up the executors correctly.
>
I meant to publish that as a project. I've just made a note of it now
and will try to get to it soon.
BTW: It was very simple. The Jetty Server class (you'll create one of
these when embedding the server) has a constructor that allows you to
specify a ThreadPool. If its execute method is implemented to schedule a
fiber instead then you'll getting a fiber created for each HTTP request.
For demo purposes at least, it means the HttpServlet::doGet or the
method implementing the REST service can block waiting for another
service or waiting for a database server without tying up a thread in
the Jetty thread pool.
-Alan
More information about the loom-dev
mailing list