Ns after

From AOLserver Wiki
Revision as of 19:36, 7 February 2009 by Gustafn (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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


ns_after - Execute a command after a time delay


ns_after seconds script


This command executes a script in the background after a number of seconds time delay. It does this by scheduling a one-shot event in the scheduler. Uncaught script errors will go to the server log. It returns an ID which can be used to unschedule the execution of the script (if seconds hasn't elapsed) using ns_unschedule_proc.
The script when executed will run in the scheduler thread. If the script is long-running, this may interfere with the execution of other scheduled scripts, in which case ns_schedule_proc should be used instead of ns_after.


   % ns_after 5 { ns_log notice "ns_after script executed" }


ns_info scheduled, ns_pause, ns_resume, ns_schedule_daily, ns_schedule_proc, ns_schedule_weekly, ns_unschedule_proc