Ejemplo n.º 1
0
        public PeriodicAlertActor(Guid deviceId, int numberOfMinutes, decimal consumptionThreshold)
        {
            var numberOfReadings = (int)Math.Ceiling(numberOfMinutes / 5M);

            _deviceId             = deviceId;
            _numberOfMinutes      = numberOfMinutes;
            _consumptionThreshold = consumptionThreshold;
            _state = new PeriodicAlertActorState(numberOfReadings);

            Receive <NormalizedMeterReading>(HandleNormalizedMeterReading);
            Receive <ReturnLastNormalizedReadings>(HandleReturnLastNormalizedReadings);
        }
        public PeriodicAlertActor(Guid deviceId, int numberOfMinutes, decimal consumptionThreshold)
        {
            var numberOfReadings = (int)Math.Ceiling(numberOfMinutes / 5M);

            _deviceId             = deviceId;
            _numberOfMinutes      = numberOfMinutes;
            _consumptionThreshold = consumptionThreshold;
            _state = new PeriodicAlertActorState(numberOfReadings);

            Receive <NormalizedMeterReading>(HandleNormalizedMeterReading);
            // TODO 11: handle the requested state from the PersistenceActor
        }