Difference between revisions of "Nsproxy"

From AOLserver Wiki
Jump to navigation Jump to search
(New page: '''NAME''' : ns_proxy - Set connection to streaming state for streaming content via ns_write '''SYNOPSIS''' : '''ns_proxy''' ''option ?arg arg ...?'' '''DESCRIPTION''' : This command ...)
 
Line 19: Line 19:
 
* '''ns_proxy release''' ''handle''
 
* '''ns_proxy release''' ''handle''
  
: Returns a list of attribute value pairs of the actual configuration and runtime values for the specified pool. The values can be set with the Tcl command ''array set''. The command returns values for the following attributes ''minthreads'', ''maxthreads'', ''idle'', ''current'', ''maxconns'', ''queued'', ''timeout'' and ''spread'' 
+
: Release a single handle. All handles owned by a thread must be returned before any handles can be allocated again.
  
* '''ns_pools list'''  
+
* '''ns_proxy eval''' ''handle script ?timeout?''
  
: Returns a list of the configured pools
+
: Evalutes script in the proxy specified by handle. The optional ''timeout'' argument specifies a maximum number of milliseconds to wait for the command to complete before raising an error.
  
* '''ns_pools register''' ''pool server method url''
+
* '''ns_proxy cleanup'''
 +
 
 +
: Releases any handles from any pools currently owned by a thread. This command is intended to be used as part of a garbage collection step.
 +
 
 +
* '''ns_proxy config''' ''poolname'' ''?'' '''-handles''' ''value?'' ''?'' '''-timeout''' ''value?''  
  
: Register pool for requests issued to the specified ''server'', HTTP ''method'' and ''url''
 
  
 
'''EXAMPLES'''
 
'''EXAMPLES'''
  
: ns_pools get default
+
: ns_proxy get default
  
 
'''SEE ALSO'''
 
'''SEE ALSO'''
  
 
: [[ns_limits]]
 
: [[ns_limits]]

Revision as of 13:14, 31 January 2009

NAME

ns_proxy - Set connection to streaming state for streaming content via ns_write

SYNOPSIS

ns_proxy option ?arg arg ...?

DESCRIPTION

This command provides a simple, robust proxy mechanism to evaluate Tcl scripts in a separate, pipe-connected process. This approach can be useful both to isolate potentially thread-unsafe code outside the address space of a multithreaded process such as NaviServer or to enable separation and timeout of potentially misbehaving, long running scripts.
The legal options are:
  • ns_proxy get poolname ? -handles value? ? -timeout value?
Returns one or more handles to proxies from the specified pool. The pool will be created with default options if it does not already exist. The option -handle can be used to specify the number of handles allocated (default: 1). The option timeout specifies the maximum amount of time in milliseconds to wait for the handles to become available before raising an error. Requesting more than one handle in a single call (if more than one handle is required) is necessary as it is an error to request handles from a pool from which handles are already owned by the thread. This restriction is implemented to avoid possible deadlock conditions. The handle returned by this command can be used as a scalar value for other ns_proxy commands, or it can be used as Tcl command itself (see ns_proxy eval for more information).
  • ns_proxy release handle
Release a single handle. All handles owned by a thread must be returned before any handles can be allocated again.
  • ns_proxy eval handle script ?timeout?
Evalutes script in the proxy specified by handle. The optional timeout argument specifies a maximum number of milliseconds to wait for the command to complete before raising an error.
  • ns_proxy cleanup
Releases any handles from any pools currently owned by a thread. This command is intended to be used as part of a garbage collection step.
  • ns_proxy config poolname ? -handles value? ? -timeout value?


EXAMPLES

ns_proxy get default

SEE ALSO

ns_limits