Taking up Sebastian's suggestion to implement a separate message bus system, here is a very simple one, consisting of a Message, Bus, and MessageTransport Class:
http://bugzilla.qooxdoo.org/attachment.cgi?id=163&action=view The user can subscribe handler function to message filters: qx.messagebus.Bus.subscribe("my-messages.*",function(msg){ alert( "Received message " + msg.getName() + " containing data " + msg.getData() + " coming from object " + msg.getSender() ); },optionalContextObject); myMsg = new qx.messagebus.Message("my-messages.delete-all-data", "I am kidding!"); myMsg.setSender(this); qx.messagebus.Bus.dispatch(myMsg); Messages can also be forwarded from the client to the server using json-rpc var messageTransport1 = new qx.messagebus.MessageTransport('showcase.transport.*','toServer'); messageTransport1.setServiceUrl('../backend/php/services/index.php'); messageTransport1.setServiceName('qxtransformer.showcase'); messageTransport1.setServiceMethod('echoClientMessage'); and, through server polling, messages can be forwarded from the server to the client: var messageTransport2 = new qx.messagebus.MessageTransport('*','toClient'); messageTransport2.setInterval(5000); messageTransport2.setServiceUrl('../backend/php/services/index.php'); messageTransport2.setServiceName('qxtransformer.showcase'); messageTransport2.setServiceMethod('getServerMessages'); incoming messages are then dispatched and can be subscribed to. See demo at http://qxtransformer.sourceforge.net/svn/trunk/apps/qxtransformer-skeleton/build/ (Click on "message bus" tab). I'd be happy if this could be made part of the trunk. The classes are very basic, but work well and can be extended very easily. The only problem is server polling at the sourceforge demo site - the timer runs amok and won't respect interval setting. It works well on my localhost... Christian Sebastian Werner schrieb: > Am 18.05.2007 um 14:11 schrieb [EMAIL PROTECTED]: > > >> Sebastian Werner <[EMAIL PROTECTED]> writes: >> >> >>> I don't like the solution to be integrated in qx.core.Target. I would >>> like it better to add specific events to a special event router which >>> then informs registered objects about any of these events. This is a >>> lot cleaner than exclude tables and a deep integration in >>> core.Target. The overhead of many events would be to dramatic. I can >>> imagine of something like a widget monitor which reacts on all >>> widgets relevant stuff and for example a IO monitor which monitors >>> all IO related things. >>> >>> What do you think? >>> >> Hi Sebastian, >> >> That concept sounds fine. I'm not sure I follow where you'd add >> it, though, >> if not in Target. If one wants to monitor all, or some very large >> subset of >> events, where else could you put it that has access to the >> information? >> >> I expect that in the implementation I checked in last night, the >> overhead is >> quite small since it effects only events with listeners if the >> variant isn't >> enabled. I am concerned about the overhead when the variant _is_ >> enabled. >> > > Derrell, > > Each overhead even if really really little is to much in my opinion > because it also sits on time critical stuff. The whole idea for the > message bus is instead to use it only for not-so time crititcal > information. > > I would say, that a first step, before implementing something is, to > get a clear view of which currently existing events are interesting. > I think a whitelist is better than a blacklist in this case. A > message bus listener which reacts on all the possible events of > different areas e.g. io, widgets, focus, whatever is not quite often > - if it exist at all. > > >> I'd definitely like to hear more about how you would implement the >> special >> event router. Sounds quite interesting! >> > > OK, lets continue our discussion on Monday. > > Sebastian > > >> Cheers, >> >> Derrell >> >> ---------------------------------------------------------------------- >> --- >> This SF.net email is sponsored by DB2 Express >> Download DB2 Express C - the FREE version of DB2 express and take >> control of your XML. No limits. Just data. Click to get it now. >> http://sourceforge.net/powerbar/db2/ >> _______________________________________________ >> qooxdoo-devel mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel >> > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > qooxdoo-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel > ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
