コード例 #1
0
ファイル: App.cs プロジェクト: FlipperCoin/AutofacTesting
 public void Run()
 {
     foreach (var input in _inputs ?? Enumerable.Empty <InputMetadata>())
     {
         System.Console.WriteLine($"configurated input: {{hostname: {input.Hostname}, retries: {input.Retries}}}");
     }
     _dep.DoSomething();
 }
コード例 #2
0
 public async Task Run(CancellationToken cancellationToken)
 {
     while (!cancellationToken.IsCancellationRequested)
     {
         try {
             // do something like claim a resource
             await dependency.DoSomething();
         } catch (Exception e) {
             // catch exceptions and print to the log
         } finally {
             // release the resource
         }
     }
 }
コード例 #3
0
 public void DoSomething()
 {
     Dependency.DoSomething();
 }