2013-06-19 12:04:09 +00:00
|
|
|
module EventBuffer
|
|
|
|
|
|
|
|
def self.list
|
|
|
|
Thread.current[:event_buffer] || []
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.add(item)
|
|
|
|
if !Thread.current[:event_buffer]
|
|
|
|
Thread.current[:event_buffer] = []
|
|
|
|
end
|
|
|
|
Thread.current[:event_buffer].push item
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.reset
|
|
|
|
Thread.current[:event_buffer] = []
|
|
|
|
end
|
|
|
|
|
2015-04-27 14:15:29 +00:00
|
|
|
end
|