Package coilmq :: Module scheduler :: Class RandomQueueScheduler
[frames] | no frames]

Class RandomQueueScheduler

            object --+    
                     |    
QueuePriorityScheduler --+
                         |
                        RandomQueueScheduler

Implementation of QueuePriorityScheduler that selects a random queue from the list.

Instance Methods
str
choice(self, queues, connection)
Chooses a random queue for messages to specified connection.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

choice(self, queues, connection)

 

Chooses a random queue for messages to specified connection.

Parameters:
  • queues (dict of str to set of stompclient.frame.Frame) - A dict mapping queue name to queues (sets of frames) to which specified connection is subscribed.
  • connection (coilmq.server.StompConnection) - The connection that is going to be delivered the frame(s).
Returns: str
A random queue destination or None if list is empty.
Overrides: QueuePriorityScheduler.choice