jsr340-experts@servlet-spec.java.net

[jsr340-experts] Re: Non-blocking changes

From: Greg Wilkins <gregw_at_intalio.com>
Date: Wed, 24 Oct 2012 23:55:47 +1100

On 23 October 2012 18:50, Rémy Maucherat <rmaucher_at_redhat.com> wrote:
> +1
>
> In previous discussions on the list, I described canWrite (now isReady)
> returning false as the trigger for the listener invocation, since otherwise:
> - there will be concurrency issues
> - the amount of callbacks will not be optimal
>
> For read, it is the same behavior: the Servlet should be forced to read all
> available data.
>
> I remember this clarification of the behavior was very well received, in
> particular by Greg (see the archives).

Yes - I think it is a good mechanism because it avoids the hassle of
being concerned about which thread dispatches the callback on a write
that just completes.

But I'm now confused about what is being proposed. Shing said:

> I propose to change the behavior that there is no need to do (a) above.
> The WriteListener#onWritePossible will be invoked once for every write operation permitted.

which I take to mean that the callback will be call no matter what -
ie it is not dependent on a false return from canWrite (or isReady).


-- 
Greg Wilkins <gregw_at_intalio.com>
http://www.webtide.com
Developer advice and support from the Jetty & CometD experts.