Fix miscellaneous bugs again

This commit is contained in:
v 2021-02-14 20:04:12 +00:00
parent 287c7a0709
commit 80206bafde
4 changed files with 6 additions and 6 deletions

View File

@ -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()}

View File

@ -1,5 +1,5 @@
{
["version"] = "0.1.2-1",
["version"] = "0.1.2-2",
["dependencies"] = {},
["description"] = "Adds convinientish multitasking functionality.",
["files"] = {

View File

@ -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

View File

@ -1,5 +1,5 @@
{
["version"] = "0.1.0",
["version"] = "0.1.1",
["dependencies"] = {
"multitask",
},