View · Index
No registered users in community rubick
in last 10 minutes

Aolserver Notes

Tuning Guide

New loop control constructs

From Nathan Folkman at AOL:

In AOLserver 4.5 the following new Tcl APIs are provided:


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

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

server1:nscp 10> ns_loop_ctl resume 0

server1:nscp 11> ns_loop_ctl cancel 0

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"
ns_return 200 text/plain [ns_httpsget $outbound_https_url]
Then browse to the url of the test page, for example:

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:
Search page: