ad_job (public)

 ad_job [ -queue queue ] [ -timeout timeout ] [ args... ]

Defined in packages/acs-tcl/tcl/utilities-procs.tcl

Convenience wrapper for simple usages of ns_job provided by AOLServer and NaviServer. The provided command (args) is executed in a separate thread of the specified job queue. On success the function returns the result of the provided command. If the queue does not exist, the queue is generated on the fly with default settings. When the timeout is specified and it expires, the client side will raise an error. Note that the executing job is not canceled but will run to its end.

Switches:
-queue
(defaults to "jobs") (optional)
Name of job queue
-timeout
(optional)
timeout for job, might be 1:0 for 1 sec
Returns:
result of the specified command
Author:
Gustaf Neumann

Partial Call Graph (max 5 caller/called nodes):
%3 test_ad_job ad_job (test acs-tcl) ad_job ad_job test_ad_job->ad_job download_file_downloader download_file_downloader (public) download_file_downloader->ad_job

Testcases:
ad_job
Source code:

    if {$timeout ne ""} {
        set timeout "-timeout $timeout"
    }
    if {$queue ni [ns_job queues]} {
        ns_job create $queue
    }
    set j [ns_job queue $queue $args]
    return [ns_job wait {*}$timeout $queue $j]
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/acs-tcl/tcl/utilities-procs.xql

[ hide source ] | [ make this the default ]
Show another procedure: