[ Previous ] [ Contents ] [ Index ] [ Next ]

ns_schedule_proc

Overview

Schedule a procedure to run at specified intervals

Syntax

ns_schedule_proc ?-thread? ?-once? interval {script | procname ?args?}

Description

ns_schedule_proc runs the specified Tcl script or procedure (procname) at an interval specified by interval. The interval is the number of seconds between runs of the script.

Specify -thread if you want a thread created to run the procedure. This will allow the scheduler to continue with other scheduled procedures. Specifying -thread is appropriate in situations where the script will not return immediately, such as when the script performs network activity.

Specify -once if you want the script to run only one time. The default is that the script will be re-scheduled after each time it is run.

ns_schedule_proc returns an id number for the scheduled procedure that is needed to stop the scheduled procedure with ns_unschedule_proc.

Example

    proc dosomething blah {
        ns_log Notice "proc with arg '$blah'"
    }
    ns_schedule_proc 10 dosomething $arg1

Top of Page

[ Previous ] [ Contents ] [ Index ] [ Next ]
Copyright © 1998-99 America Online, Inc.