class Gwitch::Region

Public Class Methods

games() click to toggle source
# File lib/gwitch/region.rb, line 9
def self.games
  semaphore = Mutex.new
  games = []

  threads = 
    [Americas, Asia, Europe].map do |region|
      Thread.new do
        semaphore.synchronize {
          games += region.games
        }
      end
    end
  threads.each(&:join)
  games
end