class UnifiedQueues::Single::Driver
Abstract single driver class. @abstract
Abstract single driver class. @abstract
Abstract single driver class. @abstract
Abstract single driver class. @abstract
Abstract single driver class. @abstract
Abstract single driver class. @abstract
Abstract single driver class. @abstract
Attributes
Holds native object. @return [Object]
Public Class Methods
Constructor.
# File lib/unified-queues/single/driver.rb, line 38 def initialize(cls, *args, &block) if self.instance_of? UnifiedQueues::Single::Driver not_implemented end if cls.kind_of? Class @native = cls::new(*args, &block) else @native = cls end end
Public Instance Methods
Clears the queue. @abstract
# File lib/unified-queues/single/driver.rb, line 92 def clear!(&block) while not self.pop.nil? end end
Indicates queue is empty.
@param [Boolean] true
if it's, false
otherwise @abstract
# File lib/unified-queues/single/driver.rb, line 83 def empty?(&block) not_implemented end
Indicates, driver is evented so expexts callbacks. @return [Boolean] true
if it is, false
otherwise
# File lib/unified-queues/single/driver.rb, line 130 def evented? self.type == :evented end
Returns length of the queue.
@return [Integer] @abstract
# File lib/unified-queues/single/driver.rb, line 106 def length(&block) not_implemented end
Indicates, driver is evented so expexts callbacks. @return [Boolean] true
if it is, false
otherwise
# File lib/unified-queues/single/driver.rb, line 139 def linear? self.type == :linear end
Pops value out of the queue.
@param [Boolean|Integer] blocking true
or timeout if it should block, false
otherwise @param [Object] queue value @abstract
# File lib/unified-queues/single/driver.rb, line 72 def pop(blocking = false, &block) not_implemented end
Pushes the value into the queue.
@param [Object] value value for push @param [Object] key key for priority queues @abstract
# File lib/unified-queues/single/driver.rb, line 58 def push(value, key = value, &block) not_implemented end
Returs type of the queue. Queue can be :linear
which means, calls values are returned using return
or :evented
which indicates necessity of callbacks.
@return [:linear, :evented] @abstract
# File lib/unified-queues/single/driver.rb, line 121 def type not_implemented end