Tom Jackson wrote:

Have you looked at ns_ictl to see what the relationship is between this and 
what you are doing? Somehow I think that ns_ictl does a lot of this type of 
thing, but there are no examples of use. 
The ns_package uses ns_ictl oninit to set the package info in a new interp.  The 4.5 ns_ictl package procedure does a package require on allocate, which can have additional side effects since the package is actually reload in each interp when the interp is allocated,
I have complained about the changes to ns_atclose which now requires a conn to 
work, and the response has been that ns_ictl should be used instead. I have 
not spent the time to figure out how. Somehow this depends on internal code, 
maybe ns_ictl could be modified to print (log debug) whenever a state has 
changed, which would trigger any code registered via ns_ictl. Then it might 
be easy to run tests to see if actions happen at the right point. 
With 4.5, you now have ns_ictl trace "create|delete|allocate|deallocate|getconn|freeconn" so that you can set you own scripts at any point.  I have had problems with ns_atclose causing core faults even in 4.0.10 (but it could have been related to the specific build paltform)
The idea of converting (I guess that is the idea) modules into Tcl packages 
sounds helpful. Modules seem more difficult than packages. First, there is 
configuration information. One thing missing from Tcl is a centralized 
configuration and logging facility. What happens instead is that you import a 
package into your script and handle things as you like. Maybe this is one 
more thing that AOLserver could provide to Tcl, some kind of 
configuration/management/monitoring framework. Obviously it is not needed for 
simple scripts, and we can't get the configuration stuff yet in libnsd.

I also changed a few things in the nstclsh code, now I have an nswish with 
everything in nstclsh+wish. It seems like this could be further modified to 
load a config file. Even if AOLserver C modules cannot be loaded, the config 
could be used for Tcl packages (even specify which ones to load).

tom jackson

On Thursday 09 August 2007 15:35, Jay Rohr wrote:
 Using TCL packages solves a lot of the problems, however there are some
issues that need to be  managed within an nsd.  I have a number of
AOLservers instances that have a very minimum init file and a single tcl
modules file that only has a single "package require" to start, load (TCL
and binary packages), and initialize a complete AOLserver instance.

 The "issue" is that the package information, (both TCL and binary) is
stored within the TCL binary code and the AOLserver cloning does not
maintain it.  I have written an ns_package package :-) that overrides the
TCL package command to track this information and updated it when a new
interp is created.  This works with both 4.0.10 and 4.5.  The packages
loaded must be thread safe to work.  I have used, tdom, curl, and home
grown and 3rd party TCL and binary packages.

 It also handles the automatic calling of package procedures during server
startup and shutdown if they are defined in the package.  {package}::nsInit
is called immediately after the package is loaded, {package}::nsPostInit is
called (in load order) after the server startup has completed and a fully
defined interp is ready.  {package}::nsShutdown is called (in reverse load
order)  at server shutdown.  In 4.5, it could also be set to call
procedures are interp allocate, conn, conn close, and deallocate.  Modules
could easily (I think) be converted to packages.

 Some people (just trying to get it on the table for discussion) do not
like the fact that I overloaded the TCL package command, but I think it
makes the integration and management of third party packages easier and

AOLserver -

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.


-- AOLserver -

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with the body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.

fn:Jay J. Rohr
email;internet:[EMAIL PROTECTED]

Reply via email to