コード例 #1
0
 public void Dispose()
 {
     ScopedBusControl?.StopAsync();
     BusControl?.StopAsync();
     ServiceScope?.Dispose();
     Logger.LogInformation($"{Id} Bus stopped, scope disposed");
 }
 public async Task StopAsync(CancellationToken cancellationToken = new CancellationToken())
 {
     lock (this)
     {
         if (!IsBusControlCreated)
         {
             return;
         }
     }
     await BusControl.StopAsync(cancellationToken);
 }