Calculation Service
Introduction
Calculation Service is a process that can be started by the external application to immediately perform calculations via SMath Studio. Calculation Service is an optional component of SMath infrastructure available only with a proper licensed SMath Studio Enterprise installation for our commercial customers. It is important to understand that Calculation Service is not registered in the operating system as a service, and its full lifecycle completely depends on the calling application.
Calculation Service API Lifecycle
Working with Calculation Service is performed as follows:
- Start Calculation Service. Optionally it is possible to specify the port to use or it will be allocated dynamically otherwise. API may be used to get an allocated port then.
- Started Calculation Service loads the application components. It may take a few seconds, depending on your hardware and installed add-ons amount in SMath Studio Plugins.
- Calculation Service may be started manually in a command line, or you may initiate new service instance via API call.
- Request connection to the service started in the previous item. You will need a port to be used.
- Prepare .sm file to calculate and format input data.
- Initially the service was created for internal use and it caused using internal XML based format. In order to simplify input/output data handling special plugin type was introduced.
- Request to calculate .sm file(s) indicating initial data and returning calculation results format.
- Calculation occurs as quickly as possible, because application components are already loaded in memory and ready to make requests.
- Close connection(s) to the service and terminate the Calculation Service process.
- After Calculation Service process is completed, its process is unloaded from memory and no longer available for any external applications interaction.
Examples
In order to simplify developer's introduction into how to work with Calculation Service several examples have been developed and made available in our public sources repository under https://smath.com/svn/public/integration
At the moment .NET based and Delphi based examples are available. More environments will be covered later.