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); }
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; } }
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; } } }
private void Handle(StartListening _) { MQReceiver.StartListening(Topic); Self.Tell(new Read()); }