Hi,
I've been working on additions to CometEvent to implement the additional
Comet functionality that was agreed upon before creating the "trunk"
branch. Although not functional at the moment, I consider it to be
developed enough from an algorithmic standpoint to be proposed and
reviewed (it is also important to not continue an API fork for too long,
since otherwise it would be harder to merge, so some resolution is
needed). I went through a few revisions of the API, as more tweaks
appeared possible. The idea was to allow the extra functionality without
adding complexity or incompatible changes, since this is most likely
going to be an interim API.
The repository is at:
https://svn.apache.org/repos/asf/tomcat/sandbox/comet
It has the following changes over the 6.0.x branch:
- additions of four methods in CometEvent (sleep and callback, and the
two flags isRead(Write)able)
- sleep delays request processing until either callback is called, or a
timeout occurs
- callback allows waking up requests which are "asleep" or waiting for
an IO event
- non blocking IO exclusively in Comet mode, since it now seems to me it
is algorithmically equivalent to blocking IO; for read, it has been
demonstrated previously; for write, it seems there should always be
write events after a properly handled congestion (where the servlet uses
isWriteable), since if the servlet does not, it will be best to simply
fail-fast the connection using an IOException (the servlet would
effectively only handle clients which are "fast enough" if using the
Comet API like in Tomcat 6.0, which avoids a lot of issues)
- isRead(Write)able indicate if data may be read or written (since this
is non blocking IO, reading or writing would read or write 0 bytes); if
it is false and reading or writing is done, an IO exception will be thrown
- no additional data structures
- new ActionCode: ACTION_COMET_TIMEOUT (which is cleanup),
ACTION_COMET_CALLBACK (called by the callback() method),
ACTION_COMET_SLEEP (called by the sleep() method), ACTION_COMET_WRITE
(called by the CometEvent.isWriteable method without the need for an
explicit callback from the servlet - isWriteable knows the result of the
last write, and the servlet is supposed to not attempt any further
writing if isWriteable returns false)
- no additional features, like verification of caller threads (which I
consider useless)
I hope I did not forget anything.
Comments ? / Votes ?
Rémy
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]