Giter VIP home page Giter VIP logo

Comments (6)

lawsonAGMT avatar lawsonAGMT commented on May 20, 2024

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.

KennanChan avatar KennanChan commented on May 20, 2024

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.

lawsonAGMT avatar lawsonAGMT commented on May 20, 2024

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.

KennanChan avatar KennanChan commented on May 20, 2024

@lawsonAGMT https://github.com/cefsharp/CefSharp/wiki/Advanced-Async-JavaScript-Binding-(JSB)

from revit.async.

KennanChan avatar KennanChan commented on May 20, 2024

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.

lawsonAGMT avatar lawsonAGMT commented on May 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.