# README
plugin 
Usage
local plugin = require("plugin")
local time = require("time")
local plugin_body = [[
local time = require("time")
local i = 1
while true do
print(i)
i = i + 1
time.sleep(1)
end
]]
-- plugin.do_string(body)
-- also you can use: plugin.do_file(filename)
local print_plugin = plugin.do_string(plugin_body)
print_plugin:run()
time.sleep(2)
print_plugin:stop()
time.sleep(1)
local running = print_plugin:is_running()
if running then error("already running") end
-- also you can get last error: print_plugin:error()
-- plugin.do_string_with_payload()
-- also you can use: plugin.do_file_with_payload(filename)
local job_body = [[
print(payload)
]]
local print_plugin_with_payload = plugin.do_string_with_payload(plugin_body, "text of payload")
print_plugin_with_payload:run()
-- must print: "text of payload"
time.sleep(1)
local running = print_plugin:is_running()
if running then error("already running") end
# Functions
DoFile lua plugin.do_file(filename) returns plugin_ud.
DoFileWithPayload lua plugin.async() returns (plugin_ud, err).
DoneChannel lua plugin_ud:done_chan().
DoString lua plugin.do_string(body) returns plugin_ud.
DoStringWithPayload lua plugin.async() returns (plugin_ud, err).
Error lua plugin_ud:error() returns err.
IsRunning lua plugin_ud:is_running().
Loader is the module loader function.
No description provided by the author
NewPluginState return lua state.
Preload adds plugin to the given Lua state's package.preload table.
PreloadAll preload all gopher lua packages - note it's needed here to prevent circular deps between plugin and libs.
Run lua plugin_ud:run().
Stop lua plugin_ud:stop().
Wait lua plugin_ud:wait().