SubmitAsync () method
The method SubmitAsync of the class Aia.ITP.Server.Job submits the job to the Communications Manager Core running on the host and port specified by the properties Host and Port. The method returns immediately after the job has been submitted, without waiting until the job has been processed. If the method returns normally, this means that the job was submitted successfully. If an error occurs during the submission of the job, an exception is thrown. If an error occurs during the processing of the job, this is not reported.
In contrast to the method Submit, the method SubmitAsync does not allow for the exchange of data values, files, or progress messages with Communications Manager Core. If these mechanisms are needed, the method Submit must be used instead.
The class Aia.ITP.Server.Job exposes the following properties:
- Host
- Port
- JobID
- Service
- Parameters
- SessionID
- ConfirmCompletion
- KeepAlive
- NoDelay
- PrivateTransfer
- UserID
- ApplicationID
The property Host is a string that specifies the host name of the machine running Communications Manager Core. You can specify the name either in (IPv4) Internet Protocol dotted address notation (a.b.c.d), or as a resolvable host name.
The property Port is a string that specifies the port number on which Communications Manager Core is running. You can specify the port either in numerical format or as a Service name resolved through any available Service databases.
The property JobID is a string used to identify the job on Communications Manager Core. Also, it appears in the Communications Manager Core log files in all log lines that describe the job run.
The property Service is a string that specifies the name of Communications Manager Core Service that the job should invoke.
The property Parameters is a read-only property of type List<String>. It contains the list of parameters passed to the Communications Manager Core Service. To add or remove parameters, manipulate the object List<String> returned by this property, using the standard methods provided by the .NET Framework. Parameters cannot be null. The empty string is interpreted as if the parameter was not passed, which causes the default value to be substituted (if any).
The property SessionID is a string that specifies the Communications Manager Core session ID that will be associated with the submitted job. Communications Manager Core session IDs serve multiple purposes:
- Mutual exclusion. The Communications Manager Core guarantees that multiple requests for the same session ID are not handled in parallel by multiple Document Processors. Instead, multiple simultaneous requests with the same session ID are queued and processed in a series.
- Persistent storage across jobs. Communications Manager Core Services may use the session ID to store information across several Communications Manager Core jobs, so that each job can use data stored by earlier jobs.
You can specify session IDs for mutual exclusion by the calling the client. Session IDs for persistent storage are always generated by Communications Manager Core and must be sent to the calling client using the mechanism exchange_data. For convenience, the class Aia.ITP.Server.Job allows the Communications Manager Core Service to pass a session ID using the mechanism exchange_data and using the key "SessionID" (case-insensitive). The data value of such a data exchange request is automatically stored in the property SessionID of the object Aia.ITP.Server.Job. This functionality works regardless of whether the ExchangeData event is being handled.
For more information about the use of session IDs in Communications Manager Core, see the section Communications Manager Core sessions of the Tungsten Communications Manager Core Scripting Language Developer's Guide.
The boolean property ConfirmCompletion specifies that Communications Manager Core should not regard the job as completed until the client, such as the object Aia.ITP.Server.Job, has confirmed to Communications Manager Core that it has received the message stating that the job has completed. This setting has no effect when the job is submitted using SubmitAsync. This property is set to false by default.
The boolean property KeepAlive specifies that the Aia.ITP.Server.Job object should send confirmation messages to Communications Manager Core to indicate that it is still listening, upon request from Communications Manager Core. This setting corresponds to the setting "Verify connection" that you can find on the Advanced tab of Communications Manager Core Administrator. This setting has no effect when the job is submitted using SubmitAsync. The property is set to false by default.
The boolean property NoDelay specifies that the underlying TCP/IP connection to Communications Manager Core should not use Nagle's algorithm to put as much data as possible into a single network packet. Enabling this option significantly reduces network latency, but also leads to a significant increase in network traffic. The property is set to false by default.
The boolean property PrivateTransfer specifies that the Communications Manager Core load balancer should be bypassed for file transfers. Enabling this option may increase performance for large file transfers. The property is set to false by default.
The properties UserID and ApplicationID are strings used for the submission of Communications Manager ComposerUI Server jobs. UserID specifies the user name of the user connected to Communications Manager ComposerUI Server while the ApplicationID identifies the Communications Manager ComposerUI Server application that submits the job. It is not necessary to specify these properties.