[EMAIL PROTECTED] wrote:
Author: fhanik
Date: Thu May 10 04:30:29 2007
New Revision: 536830

URL: http://svn.apache.org/viewvc?view=rev&rev=536830
Log:
New proposed API calls for Comet
+    /**
+     * notification bit to receive an event
+     * immediately, the event will be NOTIFY/WRITE
+     * @see #register(int)
+     */
+    public static final int OP_NOW = 0x001;
+ + /**
+     * notification bit to receive an event when
+     * data has arrived on the connection
+     * Event will be READ
+     * @see #register(int)
+     * @see CometProcessor#event(CometEvent)
+     */
+    public static final int OP_READ = 0x004;

Besides the cute boolean tricks that are soooo cool, I think an enum should be used.

+    public void register(int notificationOptions)
+        throws IOException, ServletException, IllegalStateException;

The throws list for all these methods is a bit abusive. IOException, maybe it would be useful (but I will remove it if it's not), but ServletException ??

I am ok with proceeding based on that, but I'll likely ask for adjustment of some behaviors. For example, I am not convinced with the registration for read after each read event (it could maybe cause a leak like the one I fixed recently; I think it could be avoided, but this requires passing around flags, which is a bit annoying).

> there is one inconsistency,
> currently READ is a main type, while WRITE is a subtype of NOTIFY
> thoughts on consolidate these? ie NOTIFY/READ or make WRITE a main type

If you think about NOTIFY as a name, then all events could be NOTIFY/something. Since this is not very practical, I would not be using a NOTIFY in the event type.

Rémy

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to