Deprecate bulk methods of QueueIF

Jean Morissette <[email protected]> Fri, 24 Dec 2004 01:20:26 -0500
Newsgroups gmane.comp.java.seda.user
Message-ID <[email protected]>
I don't think that we need bulk operations like QueueIF.enqueue_many 
that atomically enqueues many elements.  The reasons is simple, elements 
that was atomically enqueued could be dequeued by different threads (and 
an atomic chunk of elements could be fragmented), so the handler could 
receive the elements in any order.

Controlling the elements order is done with the BatchSorterIF, not with 
atomic bulk enqueue methods.

A usefull property of QueueIF.enqueue_many is that it must enqueue all 
of the elements or none of them.  But, we have already a transactional 
API that achieve the same thing.

Thus, I suggest to deprecate these bulk methods:
QueueIF.enqueue_many
BlockingQueueIF.blocking_dequeue_all(int timeout_millis)
BlockingQueueIF.blocking_dequeue(int timeout_millis, int num)

The only bulk operation that we need is dequeueAll with the same 
semantic than j.u.concurrent.Queue.drainTo.

Another advantage would be to have an API with the same semantic than 
j.u.concurrent.Queue/BlockingQueue, thus more familiar to the users. 
Also, it would be more easy to create an adapter to use JDK5 Queue.

Any objection?




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/