Hi John,
It doesn’t sound right – the ExcelAscynUtil.Run should return immediately and allow you to continue working, even for many thousands for formulae.
The actual async functions may take longer, since they are scheduled on the .NET TreadPool, which is quite small by default and grows slowly.
But that should affect how quickly you get the final result, not how quickly the initial functions run.
Maybe you can try to make a simple version of your code which still has the problem?
Otherwise you are welcome to contact me directly and we can arrange for a support session.
-Govert
--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.
To post to this group, send email to exce...@googlegroups.com.
Visit this group at https://groups.google.com/group/exceldna.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to exce...@googlegroups.com.
Hi John,
It sounds like either the ThreadPool or the Http mechanism you’re using is limiting the number of concurrent calls.
Sometimes the back-end will limit concurrent http requests from a single host.
If you’d like to arrange for a support session, you can get hold of me at gov...@icon.co.za
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.
To post to this group, send email to exce...@googlegroups.com.
Visit this group at https://groups.google.com/group/exceldna.
To view this discussion on the web visit https://groups.google.com/d/msgid/exceldna/d48aee33-06ed-4143-8b96-fc61d6ed8ec8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/exceldna/CABhHcFg-OdPdFAW7AQw%3DErBPNX2oQhducGyR-VmiSaE%2B%2BVkcdA%40mail.gmail.com.
Hi Henrik,
The AsyncBatch example is here: https://github.com/Excel-DNA/Samples/blob/master/Misc/AsyncBatchSample.cs
A simple example of using ExcelAsyncUtil.Observe is here: https://github.com/Excel-DNA/Samples/tree/master/RtdClocks/RtdClock-IExcelObservable
ExcelAsyncUtil.Run basically does Task.Run, which runs the async code on a ThreadPool thread. If you are making a large number of async tasks at once (like recalculating a sheet with lots of ExcelAsyncUtil.Run functions) and these async tasks block (like a slow calculation of a blocking network call) then it is easy to run out of threads.
You can also get into a situation where there is a recalculation loop, so when one function completed its async call and recalculates, theat triggers another function to recalculate, and when that one in turn completes the async call and recalculates, invalidates the first function again.
Using ExcelAsyncUtil.Observe gives you full flexibility in how the work is scheduled and completed.
But it is more difficult to use since you need to understand the .NET IObservable pattern and how the ExcelAsyncUtil.xxx function identifiers work (typically the function name and parameter values).
So overall this is a somewhat tricky topic.
-Govert
From: exce...@googlegroups.com <exce...@googlegroups.com> On Behalf Of Henrik Bergström
Sent: 28 April 2021 10:02
To: Excel-DNA <exce...@googlegroups.com>
To view this discussion on the web visit https://groups.google.com/d/msgid/exceldna/e33a5690-4f03-4377-b50f-5f1f5eb2f2acn%40googlegroups.com.