Skip to content

Commit 27df11d

Browse files
committed
Merge pull request kookster#26 from carbonfive/issues/skip_loading_threaded_poller-25
[kookster#25] Only require threaded_poller where necessary
2 parents 430ac2c + 6a6c836 commit 27df11d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/activemessaging.rb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ module ActiveMessaging
1414
class StopProcessingException < Interrupt #:nodoc:
1515
end
1616

17-
# Used to indicate that the processing on a message should cease,
17+
# Used to indicate that the processing on a message should cease,
1818
# and the message should be returned back to the broker as best it can be
1919
class AbortMessageException < Exception #:nodoc:
2020
end
2121

22-
# Used to indicate that the processing on a message should cease,
22+
# Used to indicate that the processing on a message should cease,
2323
# but no further action is required
2424
class StopFilterException < Exception #:nodoc:
2525
end
@@ -46,15 +46,14 @@ def self.app_env
4646
def self.load_extensions
4747
require 'logger'
4848
require 'activemessaging/gateway'
49-
require 'activemessaging/threaded_poller'
5049
require 'activemessaging/adapter'
5150
require 'activemessaging/message_sender'
5251
require 'activemessaging/processor'
5352
require 'activemessaging/filter'
5453
require 'activemessaging/trace_filter'
5554

56-
# load all under the adapters dir
57-
Dir[File.join(ROOT, 'lib', 'activemessaging', 'adapters', '*.rb')].each do |a|
55+
# load all under the adapters dir
56+
Dir[File.join(ROOT, 'lib', 'activemessaging', 'adapters', '*.rb')].each do |a|
5857
begin
5958
adapter_name = File.basename(a, ".rb")
6059
require 'activemessaging/adapters/' + adapter_name
@@ -106,7 +105,7 @@ def self.start
106105
err_msg = <<-EOM
107106
108107
ActiveMessaging Error: No subscriptions.
109-
108+
110109
If you have no processor classes in app/processors, add them using the command:
111110
script/generate processor DoSomething"
112111

lib/generators/active_messaging/install/templates/threaded_poller

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Dir["#{lib_path}/**/*.rb"].each {|file| require file unless file.match(/poller\.
2626
# require and load activemessaging
2727
require 'activemessaging'
2828
ActiveMessaging.load_activemessaging
29+
require 'activemessaging/threaded_poller'
2930

3031
# configure the connection (there can be multiple defined in broker.yml) and number of threads
3132
connection_name = 'default'

0 commit comments

Comments
 (0)