Class: SamsaraSDK::Client
- Inherits:
-
Object
- Object
- SamsaraSDK::Client
- Defined in:
- lib/samsara_sdk/client.rb
Overview
A client for ingesting events into Samsara. It is the main interface to communicate with Samsara API.
Instance Method Summary collapse
-
#initialize(config) ⇒ Client
constructor
initialize.
-
#publish_events(events) ⇒ Boolean
Publishes given events list to Ingestion API immediately.
-
#record_event(event) ⇒ Object
Pushes event to internal events’ queue.
Constructor Details
#initialize(config) ⇒ Client
initialize
15 16 17 18 19 20 |
# File 'lib/samsara_sdk/client.rb', line 15 def initialize(config) Config.setup! config @publisher = Publisher.new @queue = RingBuffer.new(Config.get[:max_buffer_size]) @activity = Thread.new { publishing_activity } if Config.get[:start_publishing_thread] end |