diff --git a/multitask/lib/multitask.lua b/multitask/lib/multitask.lua index b7ef40a..fdadb69 100644 --- a/multitask/lib/multitask.lua +++ b/multitask/lib/multitask.lua @@ -66,7 +66,7 @@ mt.newPool = function(pool_options) end pool.run = function(terminable) - terminable = terminable or true -- if false, terminate events will be echoed to coroutines instead of + terminable = terminable == true -- if false, terminate events will be echoed to coroutines instead of -- terminating this pool while true do local event = {coroutine.yield()} diff --git a/multitask/pkgmeta.ltn b/multitask/pkgmeta.ltn index 85ebaa2..077dd6e 100644 --- a/multitask/pkgmeta.ltn +++ b/multitask/pkgmeta.ltn @@ -1,5 +1,5 @@ { - ["version"] = "0.1.2-1", + ["version"] = "0.1.2-2", ["dependencies"] = {}, ["description"] = "Adds convinientish multitasking functionality.", ["files"] = { diff --git a/spudnet/lib/spudnet.lua b/spudnet/lib/spudnet.lua index b03e0b5..787a1d4 100644 --- a/spudnet/lib/spudnet.lua +++ b/spudnet/lib/spudnet.lua @@ -1,7 +1,8 @@ local mt = dofile "/lib/multitask.lua" local p = mt.newPool({crash_on_error = true}) local spudnet = {} - +local api = {} +spudnet.api = api spudnet.init = function(o) o = o or {} o.on_init = o.on_init or function() end @@ -14,7 +15,6 @@ spudnet.init = function(o) o.subchannels = o.subchannels or {} local url = "wss://spudnet.osmarks.net/v4?enc=json&force_binary=true" local ws = nil - local api = {} local since_last_ping = os.epoch"utc" local init for i,v in ipairs(o.subchannels) do @@ -143,7 +143,7 @@ spudnet.init = function(o) os.queueEvent("spudnet_ready") end p.add(init,{name="spudnet_init"}) - return api,p.run + p.run(false) end spudnet.pool = p diff --git a/spudnet/pkgmeta.ltn b/spudnet/pkgmeta.ltn index 660338c..289e3e8 100644 --- a/spudnet/pkgmeta.ltn +++ b/spudnet/pkgmeta.ltn @@ -1,5 +1,5 @@ { - ["version"] = "0.1.0", + ["version"] = "0.1.1", ["dependencies"] = { "multitask", },