directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vincent Tencé <vte...@pyxis-tech.com>
Subject RE: [eve] Event Manager
Date Thu, 04 Dec 2003 20:54:35 GMT
> I really like the Event Notifier Pattern.  May I take a stab at
> this?  If so,
> should I write it for Merlin?  Or should I create something
> generic that can
> be imbedded in any container?  The container could then implement
> a standard
> interface or something.

You could have a look at the implementation of this pattern I
mentioned in a previous mail. At least you'll save yourself
a lot of javadoc ;-).

> Here's my idea...
>
> The Event Manager will establish a queue for the events.  I'm
> thinking one
> queue is fine, just like in the pattern, although there may be a
> benefit to
> using multiple queues ( one for every event type ), please comment.

If you only want asynchronous notification, then a queue is fine.

In the GuiApp framework, we had need for both sync and async event
processing.
The implementation we did was synchronous (running in the Swing Event
thread).
To get the async functionality, we registered an aysnc event manager as a
subscriber
of the event bus, responsible for listening for some of the
events (the async ones) and enqueuing them for aysnc delivery.

> There is a single thread monitoring the queue.  When an event
> gets placed into
> the queue, the thread picks it up, creates or gets a worker
> thread from the
> pool, then goes through the subscribers, notifying each one of the event.
>
> The subscriber may or may not have its own thread pool.  We don't care :-)
>
> Let me know...  Looks like it could be fun.
>
> Wes
>
>


Mime
View raw message