Understanding the Flow of Application Data between Client and Worker
The flow of application data between client and worker is an essential part of any computational workflow. OneCompute distinguishes between two types of application data:
Worker input and output
In essence, the Application Worker can be viewed as a function that takes input prescribed by the client application and optionally output from any preceding work units. The worker processes its input and returns a result.
Assigning worker input to the WorkUnit
When composing the workflow of a job, the client application may assign input the worker when creating the WorkUnit:
MyApplicationObject myApplicationObject = ...;
var workUnit = new WorkUnit(myApplicationObject);
The WorkUnit constructor will serialize the application object to JSON by the use of JSON.NET.
If your application object has particular serialization requirements that requires configuration of the JsonSerializer used for serializing the object, you may use the optional serializationContext argument in the WorkUnit constructor to provide a custom implementation of the ISerializationContext interface.
Returning an application object as output from the Worker
The object returned from IWorker.ExecuteAsync method can be any application object that is serializable to JSON using JSON.NET, see the paragraph above.
Input or Output Files
For many computational applications, files are an essential medium of data transfer. OneCompute Platform provides the means for efficient file transfer between the client and workers, see the Managing Files section.
See also
Concepts:
Types: