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

native[RW]

Holds native object. @return [Object]

Public Class Methods

new(cls, *args, &block) click to toggle source

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

<<(value, key = value, &block)
Alias for: push
clear(&block)
Alias for: clear!
clear!(&block) click to toggle source

Clears the queue. @abstract

# File lib/unified-queues/single/driver.rb, line 92
def clear!(&block)
    while not self.pop.nil?
    end
end
Also aliased as: clear
empty?(&block) click to toggle source

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
evented?() click to toggle source

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
length(&block) click to toggle source

Returns length of the queue.

@return [Integer] @abstract

# File lib/unified-queues/single/driver.rb, line 106
def length(&block)
    not_implemented
end
Also aliased as: size
linear?() click to toggle source

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
pop(blocking = false, &block) click to toggle source

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
push(value, key = value, &block) click to toggle source

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
Also aliased as: <<
size(&block)
Alias for: length
type() click to toggle source

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