Class: FreeMessageQueue::FileQueue
- Defined in:
- lib/fmq/queues/file.rb
Overview
This queue returns everytime the same file. This is useful during debugging or to serve the admin page.
queue_manager = FreeMessageQueue::QueueManager.new(true) do
setup_queue "/dummy/file", FreeMessageQueue::FileQueue do |q|
q.file = "tmp/default_message.yml"
q.content_type = "text/yaml"
end
end
NOTE the put method is not implemented in this queue. It is a poll only queue.
Constant Summary
Constants inherited from BaseQueue
Instance Attribute Summary
Attributes inherited from BaseQueue
#bytes, #manager, #max_messages, #max_size, #size
Instance Method Summary collapse
-
#content_type=(type) ⇒ Object
CONFIGURATION OPTION sets the content_type of the file.
-
#file=(path) ⇒ Object
CONFIGURATION OPTION sets the path to the file that should be read.
-
#poll ⇒ Object
Return the file and content type.
Methods inherited from BaseQueue
Constructor Details
This class inherits a constructor from FreeMessageQueue::BaseQueue
Instance Method Details
#content_type=(type) ⇒ Object
CONFIGURATION OPTION sets the content_type of the file. This option make sense if you want to test with the webbrowser.
54 55 56 |
# File 'lib/fmq/queues/file.rb', line 54 def content_type=(type) @content_type = type end |
#file=(path) ⇒ Object
CONFIGURATION OPTION sets the path to the file that should be read
47 48 49 |
# File 'lib/fmq/queues/file.rb', line 47 def file=(path) @file_path = path end |