2014-01-30 Yann Simon <yann.simon...@gmail.com>:

> It means we cannot write real asynchronous reactive applications with
> servlet 3.1... disappointing.
>
> onDataAvailable is already something asynchronous, so starting an
asynchronous operation from it to do the same thing you're supposed to do
is not going to make things more asynchronous.

Unless you really are careful to do things exactly like in your example,
async reads is going to produce thread safety problems.

About the specific example, I'd say it doesn't work because the NIO
connector doesn't do anything to add the channel to its "poller" when ready
flips unless it is already in that state when the container thread returns,
but the APR connector does (so it would likely work).

Rémy

Reply via email to