public void Run() { foreach (var input in _inputs ?? Enumerable.Empty <InputMetadata>()) { System.Console.WriteLine($"configurated input: {{hostname: {input.Hostname}, retries: {input.Retries}}}"); } _dep.DoSomething(); }
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 } } }
public void DoSomething() { Dependency.DoSomething(); }