Created
May 29, 2011 19:38
-
-
Save FurryHead/998077 to your computer and use it in GitHub Desktop.
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
function main() | |
-- Some processing | |
if cmd == "bla" then | |
-- we got a command, pass it off to the thread manager | |
handle_command(cmd_function, ...) | |
end | |
end --loop | |
function handle_command(func, ...) | |
-- k would be the plugin's name, v is the function | |
for k,v in pairs(running_plugins) do | |
plugin = get_parent(v) | |
if plugin_running(plugin) then | |
add_to_queue(k,v) | |
else | |
add_to_running(k,v) | |
run(v) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment