Class: Phobos::Producer::PublicAPI
- Inherits:
-
Object
- Object
- Phobos::Producer::PublicAPI
- Defined in:
- lib/phobos/producer.rb
Constant Summary collapse
- MissingRequiredArgumentsError =
Class.new(StandardError) do def initialize super('You need to provide a topic name and a payload') end end
Instance Method Summary collapse
- #async_publish(*args, **kwargs) ⇒ Object
- #async_publish_list(messages) ⇒ Object
-
#initialize(host_obj) ⇒ PublicAPI
constructor
A new instance of PublicAPI.
- #publish(*args, **kwargs) ⇒ Object
- #publish_list(messages) ⇒ Object
Constructor Details
#initialize(host_obj) ⇒ PublicAPI
Returns a new instance of PublicAPI.
20 21 22 |
# File 'lib/phobos/producer.rb', line 20 def initialize(host_obj) @host_obj = host_obj end |
Instance Method Details
#async_publish(*args, **kwargs) ⇒ Object
31 32 33 34 35 36 |
# File 'lib/phobos/producer.rb', line 31 def async_publish(*args, **kwargs) Phobos.deprecate(('async_publish')) if kwargs.empty? args = normalize_arguments(*args, **kwargs) class_producer.async_publish(**args) end |
#async_publish_list(messages) ⇒ Object
48 49 50 |
# File 'lib/phobos/producer.rb', line 48 def async_publish_list() class_producer.async_publish_list() end |
#publish(*args, **kwargs) ⇒ Object
24 25 26 27 28 29 |
# File 'lib/phobos/producer.rb', line 24 def publish(*args, **kwargs) Phobos.deprecate(('publish')) if kwargs.empty? args = normalize_arguments(*args, **kwargs) class_producer.publish(**args) end |
#publish_list(messages) ⇒ Object
44 45 46 |
# File 'lib/phobos/producer.rb', line 44 def publish_list() class_producer.publish_list() end |