Class: Isaac::Queue

Inherits:
Object
  • Object
show all
Defined in:
lib/isaac/bot.rb

Instance Method Summary collapse

Constructor Details

#initialize(socket, server) ⇒ Queue

Returns a new instance of Queue.



284
285
286
287
288
# File 'lib/isaac/bot.rb', line 284

def initialize(socket, server)
  # We need  server  for pinging us out of an excess flood
  @socket, @server = socket, server
  @queue, @lock, @transfered = [], false, 0
end

Instance Method Details

#<<(message) ⇒ Object



299
300
301
302
# File 'lib/isaac/bot.rb', line 299

def <<(message)
  @queue << message
  invoke
end

#lockObject



290
291
292
# File 'lib/isaac/bot.rb', line 290

def lock
  @lock = true
end

#unlockObject



294
295
296
297
# File 'lib/isaac/bot.rb', line 294

def unlock
  @lock, @transfered = false, 0
  invoke
end