Closed bubbajoe closed 1 year ago
I am creating a function fetch for creating http requests. But I need access to the runtime to create a Promise object.
fetch
Any ideas on how I can deal with this? I tried using the RunOnLoop function inside of the fetch function, but it was never scheduled.
Which makes since since the fetch function needs to finish executing before the runtime can schedule anything else.
Add GetRuntime() *Runtime, which panics when the event loop is not running?
GetRuntime() *Runtime
Issue
I am creating a function
fetch
for creating http requests. But I need access to the runtime to create a Promise object.Any ideas on how I can deal with this? I tried using the RunOnLoop function inside of the fetch function, but it was never scheduled.
Which makes since since the fetch function needs to finish executing before the runtime can schedule anything else.
Potential Fix
Add
GetRuntime() *Runtime
, which panics when the event loop is not running?