예제 #1
0
 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();
 }