Class: Low::Events::EventPool

Inherits:
Object
  • Object
show all
Defined in:
lib/pool/event_pool.rb

Constant Summary collapse

BUFFER_SIZE =
100.freeze

Instance Method Summary collapse

Constructor Details

#initializeEventPool

Returns a new instance of EventPool.



11
12
13
# File 'lib/pool/event_pool.rb', line 11

def initialize
  @pool = Support::PoolHash.new(BUFFER_SIZE)
end

Instance Method Details

#current_event_treeObject



15
16
17
# File 'lib/pool/event_pool.rb', line 15

def current_event_tree
  @pool[stream_id] || @pool.add(stream_id, EventTree.new)
end

#event_treesObject



19
20
21
# File 'lib/pool/event_pool.rb', line 19

def event_trees
  @pool
end