in last 10 minutes
Aolserver Notes
New loop control constructs
From Nathan Folkman at AOL:
In AOLserver 4.5 the following new Tcl APIs are provided:
"ns_for"
"ns_foreach"
"ns_while"
"ns_loop_ctl"
The new AOLserver 4.5 APIs require you to use the new commands explicitly.
Here's a quick example:
server1:nscp 4> ns_thread begindetached "while 1 {ns_sleep 1:0}"
server1:nscp 5> ns_loop_ctl list
server1:nscp 6> ns_thread begindetached "ns_while 1 {ns_sleep 1:0}"
server1:nscp 7> ns_loop_ctl list
0
server1:nscp 8> ns_loop_ctl info 0
0 41973248 1149519792:592471 9 running {ns_while 1 {ns_sleep 1:0}}
server1:nscp 9> ns_loop_ctl pause 0
1
server1:nscp 10> ns_loop_ctl resume 0
1
server1:nscp 11> ns_loop_ctl cancel 0
1
server1:nscp 12> ns_loop_ctl list
If you want to gather statistics about existing "for", "foreach", and
"while" loops, simply rename those commands and have them instead point
to the new commands:
for -> ns_for
foreach -> ns_foreach
while -> while
Hope that helps!
Howto test ns_httpsget to another server
Create a test page test.tcl at the server's main directory (for openacs, usually something like service0/www). Insert the following into the file:
set outbound_https_url "https://anotherservertesturl"Then browse to the url of the test page, for example:
ns_return 200 text/plain [ns_httpsget $outbound_https_url]
http://yourdomain.com/test
You can leave off ".tcl" and ".adp" suffixes when requesting .adp/.tcl file pairs. You can use this example to test other ns_command behavior too.
Finding help on Aolserver
List archives: http://news.gmane.org/gmane.comp.web.aolserver
Search page: http://search.gmane.org/search.php?group=gmane.comp.web.aolserver&sort=relevance
Google http://www.google.com/search?q=site%3Aarticle.gmane.org+gmane.comp.web.aolserver