Ns schedule proc

From AOLserver Wiki
Jump to navigation Jump to search

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


NAME

ns_schedule_proc - Schedule a script to run after a certain number of seconds

SYNOPSIS

ns_schedule_proc ?-once? ?-thread? interval script

DESCRIPTION

This command schedules a script to be run after a certain number of seconds. Returns the ID of the newly scheduled script. If -once is specified, then the script is run once and then unscheduled, otherwise it will continue to run every interval seconds. If -thread is specified, then the script will be run in its own thread, otherwise it will run in the scheduler's thread. If the script is long-running, this may interfere with the running of other scheduled scripts, so long-running scripts should be run in their own threads.

EXAMPLES

   % set id [[ns_schedule_proc -once 60 { ns_log notice "this should run in 60 seconds" }]]
   123
   % ns_unschedule_proc $id

SEE ALSO

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

-