Comments (6)
Update: It seems that this occurs when the UI in CefSharp is continuously updated while the callback is being executed (loading animation). The weird thing is, the freezing only occurs when the addin is run without a visual studio debugger attached...
from revit.async.
Calling Wait() is not wise in UI thread, generally you can push result back when an asynchromous task finishes. If there isn't a way to do that, just do some polling to get the result periodically.
I did some research and it seems CEFSharp has supported returning Task from .NET, see cefsharp/CefSharp#2758
You can also use a callback to resolve this issue
from revit.async.
Unfortunately, Revit doesn't support the newest version of CefSharp that natively supports async :(
I suppose polling would work, thanks for the suggestion!
What exactly do you mean by using a callback to resolve it?
from revit.async.
@lawsonAGMT https://github.com/cefsharp/CefSharp/wiki/Advanced-Async-JavaScript-Binding-(JSB)
from revit.async.
If you pass a js function down to .NET, you will get an IJavascriptCallback object by which you can pass data back. In your javascript code, you can do some wrapping using Promise to use async fashion
from revit.async.
Thanks. I tried the polling method which surprisingly didn't work either.
But, an interesting turn of events.. I switched from using CefSharp with WPF to CefSharp with WinForms and everything is working again. Notably, the web page performance is much better. I think the WPF off-screen rendering technique is just so resource hungry it wasn't letting anything else get scheduled...
Looks like this is more of a CefSharp issue than Revit.Async so will close. Thanks for sharing your thoughts!
from revit.async.
Related Issues (11)
- A strongly-named assembly is required HOT 2
- Is there a way to trigger the SaveFamilyCommand() with a MouseEventArgs ? HOT 2
- RevitTask.RunAsync freezes GUI HOT 9
- Execute Console App from Revit HOT 6
- IExternalApplication Implementation HOT 2
- RevitTask.RunAsync() returns before Revit HOT 7
- Sometimes InvalidOperationException: 'Starting a transaction from an external application..." HOT 2
- Getter for UIApplication HOT 6
- NuGet HOT 1
- Can't schedule more than 1 task in a synchronous method HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from revit.async.