found this method with await to call the async method with a callback, I used it in the Argotic RSS reader:
var tcs = new TaskCompletionSource<string>(); EventHandler<SyndicationResourceLoadedEventArgs> feedReaderOnLoaded = null; feedReaderOnLoaded = (sender, args) => { feedReader.Loaded -= feedReaderOnLoaded; tcs.SetResult("");
So this works well, and I get my items.
I noticed in Fiddler that there are two calls to the RSS feed. After executing the code in the debugger, it is called once on LoadAsync and again on await tcs.Task . What to do to exclude one of the calls?
UPDATE This is a console application project, which may be here , that demonstrates this behavior.
UPDATE I changed the way I use the Argotic library to load an RSS feed using HttpClient , and then pass the contents to Argotic as a string that now produces only one call. Anyway, I would like to know why this was caused twice, if anyone has any ideas.
source share