68 lines
1.6 KiB
C#
68 lines
1.6 KiB
C#
using System;
|
|
using Esiur.Resource;
|
|
using Esiur.Core;
|
|
using Esiur.Data;
|
|
using Esiur.Net.IIP;
|
|
namespace AZ.Compute.Agent {
|
|
[ClassId("2e7cea0b000aab7ee0f0e98a60298a53")]
|
|
public class Job : DistributedResource {
|
|
public Job(DistributedConnection connection, uint instanceId, ulong age, string link) : base(connection, instanceId, age, link) {}
|
|
public Job() {}
|
|
[Annotation("() -> Void")]
|
|
[Export] public AsyncReply<object> Kill() {
|
|
var args = new Map<byte, object>(){};
|
|
var rt = new AsyncReply<object>();
|
|
_Invoke(0, args)
|
|
.Then(x => rt.Trigger((object)x))
|
|
.Error(x => rt.TriggerError(x))
|
|
.Chunk(x => rt.TriggerChunk(x));
|
|
return rt; }
|
|
[Annotation("String")]
|
|
[Export] public string Command {
|
|
get => (string)properties[0];
|
|
set => _SetSync(0, value);
|
|
}
|
|
[Annotation("Single")]
|
|
[Export] public float Cpu {
|
|
get => (float)properties[1];
|
|
set => _SetSync(1, value);
|
|
}
|
|
[Annotation("DateTime")]
|
|
[Export] public DateTime Finish {
|
|
get => (DateTime)properties[2];
|
|
set => _SetSync(2, value);
|
|
}
|
|
[Annotation("Boolean")]
|
|
[Export] public bool Finished {
|
|
get => (bool)properties[3];
|
|
set => _SetSync(3, value);
|
|
}
|
|
[Annotation("Int32")]
|
|
[Export] public int Id {
|
|
get => (int)properties[4];
|
|
set => _SetSync(4, value);
|
|
}
|
|
[Annotation("String")]
|
|
[Export] public string Name {
|
|
get => (string)properties[5];
|
|
set => _SetSync(5, value);
|
|
}
|
|
[Annotation("Single")]
|
|
[Export] public float Ram {
|
|
get => (float)properties[6];
|
|
set => _SetSync(6, value);
|
|
}
|
|
[Annotation("Object")]
|
|
[Export] public object Results {
|
|
get => (object)properties[7];
|
|
set => _SetSync(7, value);
|
|
}
|
|
[Annotation("DateTime")]
|
|
[Export] public DateTime Start {
|
|
get => (DateTime)properties[8];
|
|
set => _SetSync(8, value);
|
|
}
|
|
|
|
}
|
|
}
|