Ns eval

From AOLserver Wiki
Revision as of 15:07, 18 June 2004 by WikiSysop (talk | contribs) (imported from WiKit id 1306)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Man page: http://aolserver.com/docs/tcl/ns_eval.html


NAME

ns_eval - Evaluate tcl in multiple interpreters

SYNOPSIS

ns_eval ?-sync? ?-pending? ?args?

DESCRIPTION

This command causes args to be sourced as a script in all Tcl interpreters for the current virtual server. Normally, the ns_eval is asynchronous and the script isn't immediately evaluated in the other interpreters until their next atalloc event. If the -sync option is specified, ns_eval blocks until all servers have executed the script.
The -pending flag, which cannot be specified with any other flags or args, returns a list of the scritps still waiting to be evaluated in the various interpreters.
NOTE: This command is currently implemented in Tcl, in the source file nsd/init.tcl.

EXAMPLES

   # Set a global variable accessible from all interpreters
   ns_eval set myGlobal 1
   # Create a proc accessible from all interpreters, and wait
   # for it to be define in all of them before returning
   ns_eval -sync proc doSomething {args} { # do something }
   # Get the list of pending scripts to be eval'd
   ns_eval -pending

SEE ALSO

ns_cleanup, ns_ictl, ns_init, ns_markfordelete, ns_reinit

Category Documentation - Category Core Tcl API