NaviServer - programmable web server
4.99  5.0

[ Main Table Of Contents | Table Of Contents | Keyword Index ]

ns_runonce(n) 4.99.30 naviserver "NaviServer Built-in Commands"

Name

ns_runonce - Run Tcl script only once

Table Of Contents

Synopsis

Description

This command ensures that the passed-in script will be executed only once. In other words, when ns_runonce is executed multiple times with the same script, later invocations have no effect. The command is typically used in situations, where resources are allocated. The command requires an executing server, i.e., it can't be used in the configuration file.

COMMANDS

ns_runonce ?-global? ?--? script

-global If specified, the unique execution refers to all defined servers, otherwise, the execution will be only once per server.

script Tcl script to be executed

EXAMPLES

 ns_runonce {
   ns_cache_create mycache 0
 }

See Also

ns_atsignal, ns_atstartup, nsd

Keywords

NaviServer, callback, server built-in