private async Task RunAsync(CancellationToken cancellationToken) { // TODO: Replace the following with your own logic. while (!cancellationToken.IsCancellationRequested) { proxy.IAmAlive(); await Task.Delay(1000); } }
private async Task RunAsync(CancellationToken cancellationToken) { // TODO: Replace the following with your own logic. while (!cancellationToken.IsCancellationRequested) { Trace.TraceInformation("Working"); if(++i > 5) { break; } Trace.WriteLine( proxy.IAmAlive()); await Task.Delay(5000); } }
private async Task RunAsync(CancellationToken cancellationToken) { int brojac = 0; // TODO: Replace the following with your own logic. while (!cancellationToken.IsCancellationRequested) { proxy.IAmAlive(); Trace.WriteLine(++brojac + "I am alive."); Trace.TraceInformation("Working"); await Task.Delay(5000); // Zasto radi na 5 sekundi a na 2 ne server ne stane na 5 nego 13? } }