Rank: Advanced Member Groups: Member
Joined: 2/11/2015 Posts: 122
|
Due to the changes which prevents re-entrant situations I was hoping I could setup my JS/C# bridge code to be awaitable or use promises in order to allow web developers to get a reliable interface for avoiding race conditions.
I wanted to know if there was anything that was already provided by EO to facilitate this or if there are reasons I'm unaware of that I can't accomplish this goal.
I know that the new WebView2 project by microsoft is working to provide such a feature and was hoping we may have something here.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi, You can do it in asynchronously fashion based on this method: https://www.essentialobjects.com/doc/eo.base.waitabletask.ondone_overloads.aspxThe code will be something like this:
Code: C#
webView.QueueScriptCall(jsCode).OnDone(()=>
{
//code to be called when done
});
We do not have any plan to support async/await version in the near future because our library needs to maintain backwards compatible with .NET 2.0. In order to support async/await we must remove .NET 2.0 support first. Thanks!
|