Exemplo n.º 1
0
 public static void Serializer(object untypedInput, Orleans.Serialization.BinaryTokenStreamWriter stream, System.Type expected)
 {
     GrainInterfaces.TempratureReading input = ((GrainInterfaces.TempratureReading)(untypedInput));
     Orleans.Serialization.SerializationManager.SerializeInner(input.DeviceId, stream, typeof(long));
     Orleans.Serialization.SerializationManager.SerializeInner(input.Time, stream, typeof(System.DateTime));
     Orleans.Serialization.SerializationManager.SerializeInner(input.Value, stream, typeof(double));
 }
Exemplo n.º 2
0
 public static object Deserializer(System.Type expected, global::Orleans.Serialization.BinaryTokenStreamReader stream)
 {
     GrainInterfaces.TempratureReading result = new GrainInterfaces.TempratureReading();
     result.DeviceId = ((long)(Orleans.Serialization.SerializationManager.DeserializeInner(typeof(long), stream)));
     result.Time     = ((System.DateTime)(Orleans.Serialization.SerializationManager.DeserializeInner(typeof(System.DateTime), stream)));
     result.Value    = ((double)(Orleans.Serialization.SerializationManager.DeserializeInner(typeof(double), stream)));
     return(result);
 }
Exemplo n.º 3
0
        public Task SetTemprature(TempratureReading reading)
        {
            if (this.tempratures.Keys.Contains(reading.DeviceId))
            {
                this.tempratures[reading.DeviceId] = reading.Value;
            }
            else
            {
                this.tempratures.Add(reading.DeviceId, reading.Value);
            }

            //if (this.tempratures.Values.Average() > 100)
            //{
            //    Console.WriteLine("Average temprature is high {0}", this.tempratures.Values.Average());
            //}

            return TaskDone.Done;
        }
 public static object Deserializer(System.Type expected, global::Orleans.Serialization.BinaryTokenStreamReader stream)
 {
     GrainInterfaces.TempratureReading result = new GrainInterfaces.TempratureReading();
     result.DeviceId = ((long)(Orleans.Serialization.SerializationManager.DeserializeInner(typeof(long), stream)));
     result.Time = ((System.DateTime)(Orleans.Serialization.SerializationManager.DeserializeInner(typeof(System.DateTime), stream)));
     result.Value = ((double)(Orleans.Serialization.SerializationManager.DeserializeInner(typeof(double), stream)));
     return result;
 }
Exemplo n.º 5
0
 System.Threading.Tasks.Task GrainInterfaces.ISystemGrain.SetTemprature(GrainInterfaces.TempratureReading @reading)
 {
     return(base.InvokeMethodAsync <object>(355258925, new object[] { @reading }));
 }