Created
March 1, 2021 22:46
-
-
Save Mullets-Gavin/6b3608f40d2df18f8afd8d608af91abb to your computer and use it in GitHub Desktop.
Executor Class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local Executer = {} do | |
Executer.__index = Executer | |
function Executer.new(callback) | |
return setmetatable({ | |
callback = callback, | |
}, Executer) | |
end | |
function Executer:Destroy() | |
self.callback() | |
end | |
function Executer:Disconnect() | |
self.callback() | |
end | |
function Executer:__call(callback) | |
return self.new(callback) | |
end | |
Executer = setmetatable(Executer, Executer) | |
end | |
return Executer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment