Questions tagged [iprogress]

IProgress is an interface of .Net Framework which defines a provider for progress updates.

IProgress<T> is an interface of .Net Framework which defines a provider for progress updates.

public interface IProgress<in T>
{
    void Report(T value);
}

See Also

https://learn.microsoft.com/en-us/dotnet/api/system.iprogress-1

18 questions
8
votes
2 answers

Console messages appearing in incorrect order when reporting progress with IProgress.Report()

I have noticed a following behaviour. Console output messages appear in an incorrect folder when they are populated by IProgress. var recounter = new IdRecounter(filePath, new Progress(Console.WriteLine)); …
Bartosz
  • 4,406
  • 7
  • 41
  • 80
3
votes
1 answer

Not every result of IProgress comes out of the task

Consider following implementation, a method accepts an IProgress, iterates over 10000 objects. The numbers array variable returns 10000 objects, but the IProgress reports only between 9970 - 9980 objects. It varies per run, so some get…
Yves Schelpe
  • 3,343
  • 4
  • 36
  • 69
2
votes
2 answers

Progress class and problem with synchronization

Task Foo(IProgress onProgressPercentChanged){ return Task.Run(() =>{ for (int i = 0; i < 1000; i++){ if (i % 10 == 0) onProgressPercentChanged.Report(i / 10); //Some operation } …
2
votes
4 answers

How to synchronize a shared IProgress

I have an asynchronous method DoStuffAsync that spawns two tasks with Task.Run, and both tasks report their progress using a single IProgress object. From the user's perspective there is only one operation, so showing two progress bars (one for…
Theodor Zoulias
  • 34,835
  • 7
  • 69
  • 104
1
vote
1 answer

Getting progress of CloudBlob.DownloadToFileParallelAsync

I'm trying to download binary files from my Azure storage account. Initially, I was using CloudBlob.DownloadToFileAsync() which allowed me to supply a IProgress parameter and get progress updates of the transfer. However, on bigger > 2gb files,…
1
vote
2 answers

Using TaskCompletionSource Within An await Task.Run Call

I am getting unexpected behavior that I would like to shed some light on. I've created a simple example to demonstrate the problem. I call an async function using Task.Run, which will continuously generate results, and uses IProgress to deliver…
Cloudless
  • 19
  • 3
1
vote
1 answer

IProgress and Parallel.ForEach Sync Issues

I'm running into a sync issue involving reporting progress inside of a Parallel.ForEach. I recreated a simplified version of the problem in a Console App. The example actually only uses one item in the list. Here's the code: class Program { …
Seapoe
  • 459
  • 4
  • 15
1
vote
0 answers

System.IProgress is not supported on task-based asynchronous pattern

I have a WCF service, IMyService. In this service, there is an operation that uses System.IProgress. public async Task MyOperation(int id, IProgress progress) I used Autofac to create a client for IMyService service builder.Register(c =>…
Nhat Tran
  • 11
  • 4
1
vote
0 answers

IProgress notification in MVC model

I have started using IProgress with async/await in my MVC application (desktop) but I'm a bit confused about the design of the whole thing. I have a form/view V which starts the action of downloading data. V, will call the controller C to start the…
Gonan
  • 588
  • 7
  • 18
0
votes
1 answer

Is there way to merge a few IProgress objects?

I would like to merge two IProgress objects into one IProgress where T is a number. It should always return the average of all merged progresses. So for example progress1 = 50% and progress2 = 70% to mergedProgress = 60%. This could possibly…
formeo
  • 49
  • 5
0
votes
0 answers

Progress.Report causes Memory leak in c# wpf app

I have a background thread which is processing a lot of data. The Background Thread uses IProgress in order to report back to the UserInterface (might not be best practice?): public OrderBook UpdatedOrderBook; internal async Task…
0
votes
1 answer

cs0123 - no overload for 'ProgressChanged' matches delegate 'EventHandler' in .net core

I have trouble to register a progress changed event. with the above error message from the question title. Code: public class AudioFileSearcher { public AudioFileSearcher(string searchPath, bool includeSubFolders, Views.SoundListView.SoundList…
julian bechtold
  • 1,875
  • 2
  • 19
  • 49
0
votes
1 answer

ASP.NET Core MVC : how to store iprogress result

I am trying to implement a "real time" progress bar that displays the progress of an async task (blob upload). The task is executed in a service (of a class library), which itself is called by a web controller. Service method: public async Task…
AGuyCalledGerald
  • 7,882
  • 17
  • 73
  • 120
0
votes
2 answers

IProgress Error while material query via MPRester

I am using python 3.8 in spyder3. I am getting an error while doing: mp=MPRester('api key') data = mp.query(criteria={}, properties=['task_id']) #this line raises error The error is : NameError: name '**IProgress**' is not defined. During…
Rik Ghosh
  • 23
  • 6
0
votes
1 answer

Howto wrap EAP Pattern Method and IProgress with Task

I am using a bunch of synchron functions from my own "old" libary. These are used to backup files, compress them and upload them per example. For further use i would like to change these to async functions. Please forgive me my following long intro,…
biohell
  • 304
  • 3
  • 14
1
2