...
| ID | IEP-136 |
| Author | |
| Sponsor |
|
| Created | |
| Status | |
Motivation
...
| Code Block |
|---|
|
public interface IComputeJob<TArg, TResult>
{
IMarshaller<TArg>? InputMarshaller => null;
IMarshaller<TResult>? ResultMarshaller => null;
ValueTask<TResult> ExecuteAsync(IJobExecutionContext context, TArg arg, CancellationToken cancellationToken);
}
public interface IJobExecutionContext
{
IIgnite Ignite { get; }
bool Cancelled { get; }
} |
Example job implementation:
| Code Block |
|---|
|
public class ToStringJob : IComputeJob<object?, string?>
{
public async ValueTask<string?> ExecuteAsync(IJobExecutionContext context, object? arg, CancellationToken cancellationToken)
{
await context.Ignite.Tables.GetTablesAsync();
return arg?.ToString();
}
} |
...
- New handshake extension COMPUTE_EXECUTOR_ID
- New feature flag PLATFORM_COMPUTE_EXECUTORJOB (send non-Java jobs to server; all clients are supposed to support this)
- New feature flag PLATFORM_COMPUTE_EXECUTOR (execute jobs requested by server; only .NET client will support this for now)
- New response header flag SERVER_OP_FLAG (indicates a server->client request)
- Builds on existing notification mechanism
- Generic, allows different server ops (e.g. start job, cancel job, etc)
- New operation ClientOp.SERVER_OP_RESPONSE (client responds to a request with SERVER_OP_FLAG)
- ServerOp enum
COMPUTE_JOB_EXEC
COMPUTE_JOB_CANCEL
DEPLOYMENT_UNIT_UNDEPLOY
...