directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Rudd <justin.r...@gmail.com>
Subject Re: [Mina] Best to have prioritary messages
Date Mon, 10 Oct 2005 20:58:20 GMT
> > I face a tough problem. My server application needs to prioritize some
> > messages.
[snip]
> > Maybe using a filter?
>
>
> Well, that looks fairly like a stateful filter so I would think it is
> rather appropriate. (actually a filter is useful for anything :)
> but how do you plan to handle your priority buffer ?
>

if you are using Java 5, you can use
java.util.concurrent.PriorityBlockingQueue.  I believe the Doug Lea
concurrent package for 1.4.x includes a PriorityBlockingQueue, but I
don't recall off the top of my head.

What I'm wondering is how would the filter work?  Put a filter in that
collects the writes, add them to the priority queue, and the pop the
top one off the queue and send it to the next filter?  That sound
about right?

I haven't worked with filters at all (other than the prexisting thread
pool filters).

--
Justin Rudd
"Get the facts first.  You can distort them later."
   - Mark Twain
http://seagecko.org/thoughts/

Mime
View raw message