Module: Reckoner::Cdp::API::Streaming

Included in:
StreamingCore
Defined in:
lib/reckoner/cdp/api/streaming.rb

Instance Method Summary collapse

Instance Method Details

#insert(workflow_id, data) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/reckoner/cdp/api/streaming.rb', line 11

def insert(workflow_id, data)
  unless data.class == Array
    raise Reckoner::Cdp::InvalidArgumentError, "'data' must be an Array"
  end

  params = {
    data: data.to_msgpack,
    time: Time.now.to_i,
    workflow_id: workflow_id,
    record_id: SecureRandom.uuid
  }
  get('/api/v1/streaming', params)
end