Class: Qwirk::Adapter::InMemory::WorkerConfig
Instance Attribute Summary
#adapter_factory, #default_options, #manager, #marshal_sym, #marshaler, #name, #options, #queue_name, #queue_options, #response_options, #topic_name, #worker_class
Class Method Summary
collapse
Instance Method Summary
collapse
#count, #join, #max_count=, #min_count=, #periodic_call, #worker_stopped
#bean_attributes_changed, #initialize, #join, #marshal_response, #periodic_call, #stopped?, #to_s, #unmarshal_response, #worker_stopped
Class Method Details
.default_marshal_sym ⇒ Object
11
12
13
|
# File 'lib/qwirk/adapter/in_memory/worker_config.rb', line 11
def self.default_marshal_sym
:none
end
|
.in_process?(config) ⇒ Boolean
19
20
21
|
# File 'lib/qwirk/adapter/in_memory/worker_config.rb', line 19
def self.in_process?(config)
true
end
|
.initial_default_config ⇒ Object
15
16
17
|
# File 'lib/qwirk/adapter/in_memory/worker_config.rb', line 15
def self.initial_default_config
super.merge(:queue_max_size => 100)
end
|
Instance Method Details
#create_worker ⇒ Object
28
29
30
|
# File 'lib/qwirk/adapter/in_memory/worker_config.rb', line 28
def create_worker
Worker.new(self.name, self.marshaler, @queue)
end
|
#init ⇒ Object
23
24
25
26
|
# File 'lib/qwirk/adapter/in_memory/worker_config.rb', line 23
def init
super
@queue = Factory.get_worker_queue(self.name, self.queue_name, self.topic_name, @queue_max_size)
end
|
#queue_max_size ⇒ Object
43
44
45
|
# File 'lib/qwirk/adapter/in_memory/worker_config.rb', line 43
def queue_max_size
@queue_max_size
end
|
#queue_max_size=(max_size) ⇒ Object
47
48
49
50
|
# File 'lib/qwirk/adapter/in_memory/worker_config.rb', line 47
def queue_max_size=(max_size)
@queue_max_size = max_size
@queue.max_size = max_size if @queue
end
|
#queue_size ⇒ Object
38
39
40
41
|
# File 'lib/qwirk/adapter/in_memory/worker_config.rb', line 38
def queue_size
return 0 unless @queue
@queue.size
end
|
#stop ⇒ Object
32
33
34
35
36
|
# File 'lib/qwirk/adapter/in_memory/worker_config.rb', line 32
def stop
Qwirk.logger.debug { "Stopping #{self}" }
@queue.stop
super
end
|