Mistium / Origin-OS

originOS is a scratch desktop gui made by @Mistium
https://origin.mistium.com
34 stars 10 forks source link

[NEW OSL] Async #110

Open Mistium opened 6 months ago

Mistium commented 6 months ago
do (
  network "getsync" "https://hi.com/text.txt"
) then (
  page_data = data
  data = ""
  page = "loaded"
)

Allows osl to run a command without it stopping the execution of the window. This is likely to be made by creating a clone that runs the code, sends the result back to the original window, then deletes itself

Mistium commented 3 months ago

Still figuring this one out, i think it might end up being where async code gets added to a seperate thread, and run through at the same time as the main thread. This would still be annoying for networking though. I might end up making something like the fetch syntax for that.

get "url" with {data} using {headers} then (
  log response
)
Mistium commented 1 week ago

Might be able to use callbacks for this

do def() -> (

) then def() -> (

)