Skip to content

Instantly share code, notes, and snippets.

@FurryHead
Created May 29, 2011 19:38
Show Gist options
  • Save FurryHead/998077 to your computer and use it in GitHub Desktop.
Save FurryHead/998077 to your computer and use it in GitHub Desktop.
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