Josh,

it is a little different in Jetty-9 vs jetty-10, but we may backport 10
changes to 9, so I will describe those.

Typically a connector does not track requests, so it is not the connector
that waits for requests to drain, but the StatsHandler instead.

Any object in the component tree (the addBean, addHandler etc. on
ContainerLifeCycle that is the server and it's handlers) may implement the
Graceful interface and it will be called to obtain a Future that will be
completed once it has gracefully shutdown.

Some components just switch to a different mode - ie responses are now sent
with Connection:close so connections are not persistent, whilst others take
time: eg statshandler waits for dispatched request count to go to zero

So you may need nothing more than to deploy the statshandler.  But if you
have special stuff in your connector, then implement Graceful and you
should be called.

cheers













On Wed, 6 Jan 2021 at 01:27, Josh Spiegel <joshlak...@gmail.com> wrote:

> Hi,
>
> I've implemented a custom ConnectionFactory and Connection for a custom
> protocol (not http).  I've been using them with Server and
> ServerConnector.  I'd like to hook my connections into the Graceful
> shutdown process that is already in place.  i.e. I'd like to give my
> connections a chance to write final responses within the getStopTimeout()
> window.
>
> I'm not sure how I can add a Graceful instance into this process.  Does
> anybody know how to do this?
>
> Thanks,
> Josh
>
>
> _______________________________________________
> jetty-users mailing list
> jetty-users@eclipse.org
> To unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/jetty-users
>


-- 
Greg Wilkins <gr...@webtide.com> CTO http://webtide.com
_______________________________________________
jetty-users mailing list
jetty-users@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/jetty-users

Reply via email to