Fix miscellaneous bugs again
This commit is contained in:
parent
287c7a0709
commit
80206bafde
@ -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()}
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
["version"] = "0.1.2-1",
|
||||
["version"] = "0.1.2-2",
|
||||
["dependencies"] = {},
|
||||
["description"] = "Adds convinientish multitasking functionality.",
|
||||
["files"] = {
|
||||
|
@ -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
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
["version"] = "0.1.0",
|
||||
["version"] = "0.1.1",
|
||||
["dependencies"] = {
|
||||
"multitask",
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user