Class: ROM::Kafka::Commands::Create
- Inherits:
-
Commands::Create
- Object
- Commands::Create
- ROM::Kafka::Commands::Create
- Defined in:
- lib/rom/kafka/create.rb
Overview
The Kafka-specific implementation of ROM::Commands::Create
Instance Method Summary collapse
-
#execute(*messages) ⇒ Array<Hash>
Sends messages to the current topic/partition of Kafka.
-
#with(options) ⇒ ROM::Kafka::Commands::Create
Returns a new command where ‘:key` option is updated.
Instance Method Details
#execute(*messages) ⇒ Array<Hash>
Sends messages to the current topic/partition of Kafka
36 37 38 39 |
# File 'lib/rom/kafka/create.rb', line 36 def execute(*) tuples = .flatten.map(&method(:tuple)) producer.publish(*tuples) end |
#with(options) ⇒ ROM::Kafka::Commands::Create
Returns a new command where ‘:key` option is updated
49 50 51 |
# File 'lib/rom/kafka/create.rb', line 49 def with() self.class.new relation, key: .fetch(:key) end |