Class: Karafka::Web::Processing::Publisher
- Inherits:
-
Object
- Object
- Karafka::Web::Processing::Publisher
- Defined in:
- lib/karafka/web/processing/publisher.rb
Overview
Object responsible for publishing states data back into Kafka so it can be used in the UI
Class Method Summary collapse
-
.publish(consumers_state, consumers_metrics) ⇒ Object
Publishes data back to Kafka in an async fashion.
-
.publish!(consumers_state, consumers_metrics) ⇒ Object
Publishes data back to Kafka in a sync fashion.
Class Method Details
.publish(consumers_state, consumers_metrics) ⇒ Object
Publishes data back to Kafka in an async fashion
13 14 15 16 17 |
# File 'lib/karafka/web/processing/publisher.rb', line 13 def publish(consumers_state, consumers_metrics) ::Karafka::Web.producer.produce_many_async( prepare_data(consumers_state, consumers_metrics) ) end |
.publish!(consumers_state, consumers_metrics) ⇒ Object
Publishes data back to Kafka in a sync fashion
23 24 25 26 27 |
# File 'lib/karafka/web/processing/publisher.rb', line 23 def publish!(consumers_state, consumers_metrics) ::Karafka::Web.producer.produce_many_sync( prepare_data(consumers_state, consumers_metrics) ) end |