local A=require(script.Parent.Parent.lib.t)local b=A.callback local function O(A)assert(b(A))local O=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")O.Event:Connect(function()A()end)O:Fire()O:Destroy()end return O
--[[
	Runs a function asynchronously in its own thread.

	This is similar to spawn(), but executes immediately instead of waiting an
	arbitrary amount of time before executing the wrapped code.

	Usage:

		async(function()
			print("do something")
		end)
]]

local t = require(script.Parent.Parent.lib.t)

local asyncCheck = t.callback
local function async(callback)
	assert(asyncCheck(callback))

    local bindable = Instance.new("BindableEvent")

    bindable.Event:Connect(function()
        callback()
    end)

    bindable:Fire()
    bindable:Destroy()
end

return async
