[Ur] How to get promise return value in UrWeb Javascript FFI

Nitin Surana nsurana at usc.edu
Sun Oct 29 04:18:07 EDT 2017


Hi everyone

We have a javascript function that returns promise, which when resolved
would return a string which is what we need to send to the urweb server
(using rpc).

1. We are unable to find any javascript FFI example within urweb which
supports asynchronous return values or promises

2. Since javascript has no concept of sleep, we can't think of anyway to
block the return without freezing the UI (infinite loop checking for
promise resolution)

Any suggestions or solutions ? Has anyone tried something similar within
Urweb ?


P.S. - The async response that we're talking about is
RTCPeerconnection.createOffer(). We are trying to demonstrate how WebRTC
can simplify Urweb server communication alongside audio/video streams
sharing through p2p (bypassing the server, after initial signalling).

Thanks



-- 
Regards
Nitin Surana
MS Computer Science Student
USC, Los Angeles
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.impredicative.com/pipermail/ur/attachments/20171029/0aacca0b/attachment.html>


More information about the Ur mailing list