function
Library: Web Services Broker (OMWSB)
Import : omwsb.xmd |
export external function dispatch-request value request request using value server server to value string program using-unique-directory value switch unique-dir optional initial {false} retain value switch retain optional initial {false} args read-only stream args optional
Argument definitions
The dispatch-request function call is used by the server program to transfer the processing of a request to a service program. This function is typically used when the server is handling an unknown request and wants the processing to be done in a separate thread as opposed to processing the request itself. The program must be a WSB service program just like the service programs that are added via the add-service call.
Note that it is much more efficient to have a registered service handle a particular request than to manually recognize and dispatch them in the server loop.
If unique-dir is true, the WSB server will create a unique directory for this instance of this service prior to the instance starting. Then, when the instance later shuts down, the directory is deleted. This feature is useful for situations where services need a work area on the filesystem where they won't clash with other currently running services.
The same parameter is available on the wsb.create-server
function if this
functionality is required by all services. In general, this feature
should only be enabled for those services which require it, as it does
incur a small performance penalty during instance startup.
By default, unique directories will be created in the system temporary
directory (often /tmp/ or C:\temp). However, a different directory can
be specified as a parameter to the wsb.create-server
function.
Specifying the retain parameter is primarily useful for debugging a service which creates files and/or directories in its unique directory. This parameter should not be set to true in any other circumstance, as it leaves all the unique directories on the filesystem when the service exits.
When args is specified, a copy of the passed shelf is made and stored. The service instance can then retrieve a copy of that shelf using the read-service-arguments function.