Class: MediaProcessingTool::Publisher
- Inherits:
-
Object
- Object
- MediaProcessingTool::Publisher
- Defined in:
- lib/media_processing_tool/publisher.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#object ⇒ Object
Returns the value of attribute object.
-
#publisher ⇒ Object
Returns the value of attribute publisher.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Publisher
constructor
A new instance of Publisher.
-
#process(object, params = { }) ⇒ Object
stop.
- #publish(object, params = {}) ⇒ Object
-
#stop ⇒ Object
initialize.
Constructor Details
#initialize(params = {}) ⇒ Publisher
Returns a new instance of Publisher.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/media_processing_tool/publisher.rb', line 14 def initialize(params = {}) @logger = params[:logger] ||= Logger.new(STDOUT) @interrupted = false Signal.trap 'INT' do stop end Signal.trap 'TERM' do stop end Signal.trap 'SIGINT' do stop end #@config_file_path = params[:config_file_path] #raise ArgumentError, 'Missing required parameter :config_file_path' unless @config_file_path #load_configuration_from_file(@config_file_path) = params @publisher = UDAMUtils::GenericPublishMapProcessor.new() end |
Instance Attribute Details
#logger ⇒ Object
Returns the value of attribute logger.
9 10 11 |
# File 'lib/media_processing_tool/publisher.rb', line 9 def logger @logger end |
#object ⇒ Object
Returns the value of attribute object.
9 10 11 |
# File 'lib/media_processing_tool/publisher.rb', line 9 def object @object end |
#publisher ⇒ Object
Returns the value of attribute publisher.
9 10 11 |
# File 'lib/media_processing_tool/publisher.rb', line 9 def publisher @publisher end |
Instance Method Details
#process(object, params = { }) ⇒ Object
stop
41 42 43 |
# File 'lib/media_processing_tool/publisher.rb', line 41 def process(object, params = { }) publisher.process_object(params.merge(:object => object)) end |
#publish(object, params = {}) ⇒ Object
45 46 47 48 |
# File 'lib/media_processing_tool/publisher.rb', line 45 def publish(object, params = {}) #@object = object #publisher.process_object(object) end |
#stop ⇒ Object
initialize
32 33 34 35 36 37 38 39 |
# File 'lib/media_processing_tool/publisher.rb', line 32 def stop @interrupted = true puts 'Quitting on interrupt signal.' while true puts 'Exiting...' exit end end |