From: Vlad S. <vl...@cr...> - 2006-07-14 14:12:11
|
I still think that you could build ns_callback command that will be similar to ns_conn, i.e. it works only in the context of callback like ns_conn in the connection thread only. This way you can extend it as you wish and be backward compatible Zoran Vasiljevic wrote: > Am 13.07.2006 um 22:16 schrieb Stephen Deasey: > >> Why can't you initialise resources when you register the callback? I >> don't think I understand the problem here... > > Well, my first idea was to get a kind of "self-initializing" and > "self-cleaning" procedures. Most importantly the "self-cleaning" > as "self-initializing" is pretty easy to make with kind-of > "static" variables. > > So I *can* check if the callback is called for the first time > but I *do not* know when it is called for the last time! > Knowing when I'm called for the first time allows me to build > the internal cache, and knowing when I'm called the last time > allows me to cleanup. This way the initialization and cleanup > are inherent for the callback procedure and nothing else is > needed from the outside to make it happen. > > But... > > After thinking more and more, I see that we can't simply > generalize that to be backward compatible. And if we can't > do that, then we'd had pretty inelegant solution. Therefore > I will step back and do as you suggested: before I register > the callback I will manually initialize it, and after I > unregister I will manually invoke the cleanup. > > I just though this can be somehow simplified but must admit > that this is not simple, given the code we already have. > > So, consider this idea trashed. Sorry for the noise... > > Cheers > Zoran > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel > -- Vlad Seryakov 571 262-8608 office vl...@cr... http://www.crystalballinc.com/vlad/ |