Method: ActiveMessaging::ThreadedPoller#initialize
- Defined in:
- lib/activemessaging/threaded_poller.rb
#initialize(connection = 'default', configuration = {}) ⇒ ThreadedPoller
connection is a string, name of the connection from broker.yml to use for this threaded poller instance
configuration is a list of hashes each has describes a group of worker threads for each group, define what priorities those workers will process
[
{
:pool_size => 1 # number of workers of this type
:priorities => [1,2,3] # what message priorities this thread will process
}
]
30 31 32 33 34 35 |
# File 'lib/activemessaging/threaded_poller.rb', line 30 def initialize(connection='default', configuration={}) # default config is a pool size of 3 worker threads self.configuration = configuration || [{:pool_size => 3}] self.connection = connection self.pause = 1 end |