Software /
code /
verse
Comparison
init.lua @ 257:816b8ccb3082
verse: Add init(...) method to load connection modules (client, component, bosh, etc.)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 05 Dec 2011 15:38:18 +0000 |
parent | 247:7c58c16efa3e |
child | 259:05acf08d2e98 |
comparison
equal
deleted
inserted
replaced
256:cca89844cda7 | 257:816b8ccb3082 |
---|---|
16 local stream = {}; | 16 local stream = {}; |
17 stream.__index = stream; | 17 stream.__index = stream; |
18 stream_mt = stream; | 18 stream_mt = stream; |
19 | 19 |
20 verse.plugins = {}; | 20 verse.plugins = {}; |
21 | |
22 function verse.init(...) | |
23 for i=1,select("#", ...) do | |
24 local ok = pcall(require, "verse."..select(i,...)); | |
25 if not ok then | |
26 error("Verse connection module not found: verse."..select(i,...)); | |
27 end | |
28 end | |
29 return verse; | |
30 end | |
31 | |
21 | 32 |
22 local max_id = 0; | 33 local max_id = 0; |
23 | 34 |
24 function verse.new(logger, base) | 35 function verse.new(logger, base) |
25 local t = setmetatable(base or {}, stream); | 36 local t = setmetatable(base or {}, stream); |