Software /
code /
verse
Diff
init.lua @ 239:65a0d3fcbbad
verse: Switch connection ids to be a simple incrementing integer
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sun, 27 Nov 2011 22:48:02 +0000 |
parent | 238:9b6fca5d9a02 |
child | 240:e27bf761bea6 |
line wrap: on
line diff
--- a/init.lua Sun Nov 27 22:45:26 2011 +0000 +++ b/init.lua Sun Nov 27 22:48:02 2011 +0000 @@ -19,9 +19,12 @@ verse.plugins = {}; +local max_id = 0; + function verse.new(logger, base) local t = setmetatable(base or {}, stream); - t.id = tostring(t):match("%x*$"); + max_id = max_id + 1; + t.id = tostring(max_id); t.logger = logger or verse.new_logger("stream"..t.id); t.events = events.new(); t.plugins = {};