libraries can now work threaded if they wish (see http_requests). This means that multiple functions provided by one library can run at the same time (using thread(), see http.mers) and actually do the work they need to do simultaneously.

This commit is contained in:
mark
2023-05-09 22:11:13 +02:00
parent 9b92c5b353
commit a7bb3e67fa
13 changed files with 1127 additions and 518 deletions

17
http.mers Normal file
View File

@@ -0,0 +1,17 @@
lib mers_libs/http_requests
t = thread(() {
// because this downloads for so long, the println() will appear after the other one.
http_get("https:\//raw.githubusercontent.com/dwyl/english-words/master/words.txt").assume_no_enum()
println("got words from word list!")
})
sleep(0.5)
// this will finish before the thread does.
http_get("https:\//github.com/").assume_no_enum()
println("got github start page as html")
// t.await()
http_get("not a url").debug()