Class: Conrad::Emitters::Kinesis
- Inherits:
-
AmazonBase
- Object
- AmazonBase
- Conrad::Emitters::Kinesis
- Defined in:
- lib/conrad/emitters/kinesis.rb
Overview
Basic emitter for sending events to AWS’s kinesis event stream. The emitter will attempt to use values configured in the running environment according to the AWS SDK documentation (such as from ~/.aws/credentials).
Instance Attribute Summary collapse
-
#stream_name ⇒ String
The configured kinesis stream name.
Attributes inherited from AmazonBase
#access_key_id, #client, #region, #secret_access_key
Class Method Summary collapse
Instance Method Summary collapse
-
#call(event) ⇒ Object
Sends an event up to Kinesis.
Methods inherited from AmazonBase
Constructor Details
This class inherits a constructor from Conrad::Emitters::AmazonBase
Instance Attribute Details
#stream_name ⇒ String
Returns the configured kinesis stream name.
12 13 14 |
# File 'lib/conrad/emitters/kinesis.rb', line 12 def stream_name @stream_name end |
Class Method Details
.client_class ⇒ Object
28 29 30 |
# File 'lib/conrad/emitters/kinesis.rb', line 28 def client_class Aws::Kinesis::Client end |
Instance Method Details
#call(event) ⇒ Object
Sends an event up to Kinesis
17 18 19 20 21 22 23 24 25 |
# File 'lib/conrad/emitters/kinesis.rb', line 17 def call(event) client.put_record( stream_name: stream_name, data: event, # There's a 256 character limit on the partition key, and it's hashed down into a value used to # pick the shard to put the data on partition_key: event.first(255) ) end |