Before learning how this feature can impact memory management on the client host, it might be helpful to know how results are processed in Symphony’s default model.
In the default model, the Symphony Session Manager sends results to the client as soon as they are available. If the client makes a request for results before they arrive, the client code is blocked until the results arrive or the wait period expires. If the results arrive before the client makes a request, the results are queued (cached) in the local session’s result set. Since the delivery of results from the Session Manager is not in sync with the retrieval of results, it is possible that too many results could be queued in the API layer; this could cause the client to run out of memory and eventually terminate abnormally. One possible solution is to have the client request a specific number of results directly from the Session Manager; this feature is explained in On-demand results retrieval. This can help to manage memory usage on the client host but the requested results may not be the ones the client is really interested in.
Symphony offers another option, which enables a client to request specific tasks results via selection criteria. Using this feature, the client gets only the results it wants.
The purpose of selective task output retrieval is twofold: it controls the retrieval of results so that the client is not overloaded with results and runs out of memory, and it allows the client to retrieve only the results it is interested in. This is achieved by having the client retrieve data directly from the Session Manager instead of from the local result cache. To better understand the interaction between the client and the Session Manager, let’s look at the sequence of events.
Session Manager gets the result from the service and defers dispatching it to the client.
The client makes an API call to selectively retrieve task results from the Session Manager by supplying the task IDs for the results it wants to process.
In the non-blocking model (zero timeout), the Session Manager returns all the results (that match the task IDs) available at the time of the API call. If no matching task IDs are found, no results are returned.
In the blocking model (infinite timeout), the API call does not return until all the results with matching task IDs are available.
Selective task results retrieval can only be achieved through the client API. To use this feature, the client application must perform the following sequence:
The following code samples demonstrate selective task result retrieval for the blocking model in each supported language. Refer to the API reference documentation in the Knowledge Center for more information.
The following code samples demonstrate selective task result retrieval for the non-blocking model in each supported language. Refer to the API reference documentation in the Knowledge Center for more information.