Esempio n. 1
0
        private async Task <bool> OnStart(StartListening arg)
        {
            _eventProcessorHost = new EventProcessorHost(
                "akka-iot",
                PartitionReceiver.DefaultConsumerGroupName,
                Environment.GetEnvironmentVariable("akka-iot-hub-endpoint"),
                Environment.GetEnvironmentVariable("akka-iot-checkpoint-storage"),
                "akka-iot-checkpoints");
            await _eventProcessorHost.RegisterEventProcessorFactoryAsync(new EventProcessorFactory(_system, _tableStorage));

            return(true);
        }
Esempio n. 2
0
        private void OnAudioEventAvailable(object sender, AudioEventArgs e)
        {
            switch (e.State)
            {
            case AudioRecordState.SampleAvailable:
                RaisePropertyChanged("PeakValue");
                RaisePropertyChanged("PeakBarColor");
                break;

            default:
                DeviceList = new List <string> {
                    e.Information
                };
                StopListening.RaiseCanExecuteChanged();
                StartListening.RaiseCanExecuteChanged();
                break;
            }
        }
Esempio n. 3
0
        public void On(StartListening e)
        {
            _tcpListener = new TcpListener(IPAddress.Any, 3000);
            _tcpListener.Start();

            _running = true;
            while (_running)
            {
                try
                {
                    var client = _tcpListener.AcceptTcpClient();
                    System.Send(new ClientConnected(Addresses.ConnectionWorkers, client));
                }
                catch (Exception)
                {
                    _running = false;
                }
            }
        }
Esempio n. 4
0
 private void Handle(StartListening _)
 {
     MQReceiver.StartListening(Topic);
     Self.Tell(new Read());
 }