Skip to content

Instantly share code, notes, and snippets.

View forzenheart's full-sized avatar

lvyhe forzenheart

  • SOFTBRIDGE
  • China ShenZhen
  • 15:30 (UTC +08:00)
View GitHub Profile
@forzenheart
forzenheart / async.lua
Created June 10, 2022 19:29 — forked from Meorawr/async.lua
Lua 5.1 Async/Await
#!/usr/bin/lua5.1
--- Async/Await for Lua 5.1
-- This script implements async/await functions for Lua, allowing tasks to
-- be queued and scheduled independently.
--
-- This is just an example and has a bunch of issues, isn't tested, isn't
-- even actually used anywhere; I basically just got bored and had one of
-- those "what if?" type ideas 6 hours ago.
local co_create = coroutine.create