Beispiel #1
0
 public async Task Start()
 {
     try
     {
         this._stopSource = new CancellationTokenSource();
         _sssbService.RegisterMessageHandler(ONDEMAND_TASK_MESSAGE_TYPE, new TaskMessageHandler(this._services));
         _sssbService.RegisterMessageHandler(DEFERED_MESSAGE_TYPE, new DeferedMessageHandler(this._services));
         var tasks = _sssbService.Start(_stopSource.Token);
         _IsStopNeeded = true;
         await tasks;
     }
     catch (OperationCanceledException)
     {
         _IsStopNeeded = false;
     }
     catch (PPSException)
     {
         _IsStopNeeded = false;
         throw;
     }
     catch (Exception ex)
     {
         _IsStopNeeded = false;
         _logger.LogError(ErrorHelper.GetFullMessage(ex));
         throw new PPSException(ex);
     }
 }
Beispiel #2
0
 public async Task Start()
 {
     try
     {
         this._stopSource = new CancellationTokenSource();
         _sssbService.RegisterMessageHandler(SSSBMessage.EndDialogMessageType, new TaskEndedMessageHandler(this._services));
         var tasks = _sssbService.Start(_stopSource.Token);
         _IsStopNeeded = true;
         await tasks;
     }
     catch (OperationCanceledException)
     {
         _IsStopNeeded = false;
     }
     catch (PPSException)
     {
         _IsStopNeeded = false;
         throw;
     }
     catch (Exception ex)
     {
         _IsStopNeeded = false;
         _logger.LogError(ErrorHelper.GetFullMessage(ex));
         throw new PPSException(ex);
     }
 }