Re: [Asterisk-java-users] UserEvents
Brought to you by:
srt
From: Stefan R. <sr...@re...> - 2005-03-15 18:32:55
|
On Tue, 2005-03-15 at 11:16 -0600, Chris Howard wrote: > Thanks for your help. I named the class UserEventASGHold and all is=20 > working well. ok. i just had a look at my sources to verify whats going on there :) if the class name ends with "event" (ignoring case) that part is stripped of, if not it is takes the full class name. I added support for user events to latest cvs so if your event extends UserEvent and does not start with "userevent" that string is prepended. so you can name your class ASGHold, ASGHoldEvent, UserEventASGHold or even UserEventASGHoldEvent with latest CVS. I would prefer ASGHoldEvent for a uniform naming schema. > It looks like there are alot of changes is the connection classes. When = I=20 > decide to upgrade to the latest codebase can I expect a speed increase :)= =20 Speed has not yet been optimized. I think the biggest "problem" is currently that the ManagerEventHandlers are called within the same thread as the events are received. So if you do a lot of processing in your handleEvent() methods that will block any other events from being received and (if you registered more than one EventHandler) other EventHandlers from being called timely. There is no easy solution to this because events must be dispatched in the right order. One possible solution is to use a separate Thread for each registered EventHandler. Do you encounter speed problems right now? Do you use multiple EventHandlers? > Also I noticed that NewExtenEvent are very chatty. Would it be faster to= =20 > not register that event if I'm not using it? Yes that might improve speed but if you check for the events you are interested in early in the handleEvent() method and return fast if not interested handling these additional events should not be much of an issue. Note that not registering events received from Asterisk will fill your logs with warnings about that. For the 0.1 release i plan to add an=20 addEventHandler(ManagerEventHandler eventHandler, ManagerEventFilter filer) method to the ManagerConnection so you can indicate which events you are interested in and Asterisk-java will not bother you with the irrelevant ones. =3DStefan |