{"action":"created","issue":{"url":"https://api.github.com/repos/kripken/emscripten/issues/3641","labels_url":"https://api.github.com/repos/kripken/emscripten/issues/3641/labels{/name}","comments_url":"https://api.github.com/repos/kripken/emscripten/issues/3641/comments","events_url":"https://api.github.com/repos/kripken/emscripten/issues/3641/events","html_url":"https://github.com/kripken/emscripten/issues/3641","id":97017178,"number":3641,"title":"Call emscripten_sleep from js","user":{"login":"Deamon87","id":963394,"avatar_url":"https://avatars.githubusercontent.com/u/963394?v=3","gravatar_id":"","url":"https://api.github.com/users/Deamon87","html_url":"https://github.com/Deamon87","followers_url":"https://api.github.com/users/Deamon87/followers","following_url":"https://api.github.com/users/Deamon87/following{/other_user}","gists_url":"https://api.github.com/users/Deamon87/gists{/gist_id}","starred_url":"https://api.github.com/users/Deamon87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Deamon87/subscriptions","organizations_url":"https://api.github.com/users/Deamon87/orgs","repos_url":"https://api.github.com/users/Deamon87/repos","events_url":"https://api.github.com/users/Deamon87/events{/privacy}","received_events_url":"https://api.github.com/users/Deamon87/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-07-24T09:58:18Z","updated_at":"2015-07-31T20:41:36Z","closed_at":null,"body":"Is it possible? \r\n\r\nI want to redirect the FS calls to a particular file to HTML5 FileReader. But since FileReader is async, I need to put an execution to \"sleep\" until read operation is completed. \r\n\r\nRight now it's my understanding, that to call emscripten_sleep from js I will need to create cpp file, define  there some function with emscripten_sleep in it, expose it to js and call it from js instead of emscripten_sleep. But will this work? "},"comment":{"url":"https://api.github.com/repos/kripken/emscripten/issues/comments/126807657","html_url":"https://github.com/kripken/emscripten/issues/3641#issuecomment-126807657","issue_url":"https://api.github.com/repos/kripken/emscripten/issues/3641","id":126807657,"user":{"login":"kripken","id":173661,"avatar_url":"https://avatars.githubusercontent.com/u/173661?v=3","gravatar_id":"","url":"https://api.github.com/users/kripken","html_url":"https://github.com/kripken","followers_url":"https://api.github.com/users/kripken/followers","following_url":"https://api.github.com/users/kripken/following{/other_user}","gists_url":"https://api.github.com/users/kripken/gists{/gist_id}","starred_url":"https://api.github.com/users/kripken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kripken/subscriptions","organizations_url":"https://api.github.com/users/kripken/orgs","repos_url":"https://api.github.com/users/kripken/repos","events_url":"https://api.github.com/users/kripken/events{/privacy}","received_events_url":"https://api.github.com/users/kripken/received_events","type":"User","site_admin":false},"created_at":"2015-07-31T20:41:36Z","updated_at":"2015-07-31T20:41:36Z","body":"The emterpreter can only run compiled code, so if those stdio functions are compiled - like printf now is, after the musl-syscall branch merged - then it could work. But if non-compiled code, like a syscall, ends up executed, that would be a problem."}}