You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are examples on the web (see here) showing the usage as:
awaitecSender.FlushAsync();
However, when trying to run such a sample, the application hangs forever at this line. This is because the underling task never starts. The proper usage as the code currently is would be:
I've seen the POST commands happening behind the scenes, but the control never returns back to the method calling the "FlushAsync()".
@seanmarthur - what you have observed is a very valid observation and is indeed an issue that I too have faced.
It may also help if the return type has an object with some information about the completed work and not just "Task" itself. We have no insight to what success really means unless we capture the exception and infer the results.
I believe the FlushAsync method is implemented incorrectly:
https://github.com/splunk/splunk-library-dotnetlogging/blob/master/src/Splunk.Logging.Common/HttpEventCollectorSender.cs#L292-L298
There are examples on the web (see here) showing the usage as:
However, when trying to run such a sample, the application hangs forever at this line. This is because the underling task never starts. The proper usage as the code currently is would be:
However the consumer should not need to start this task manually - it should be returned from
FlushAsync
in a started state.Refactored
FlushAsync
example:The text was updated successfully, but these errors were encountered: