Class: SalesforceStreamer::Launcher

Inherits:
Object
  • Object
show all
Defined in:
lib/salesforce_streamer/launcher.rb

Overview

SalesforceStreamer::Launcher is the entry point for starting the Restforce Streaming API server. It is responsible for upserting each PushTopic and starting the server.

Instance Method Summary collapse

Constructor Details

#initializeLauncher

Returns a new instance of Launcher.



6
7
8
9
10
# File 'lib/salesforce_streamer/launcher.rb', line 6

def initialize
  load_server_configuration
  @manager = SalesforceTopicManager.new push_topics: @push_topics
  @server = Server.new push_topics: @push_topics
end

Instance Method Details

#runObject

Manages each PushTopic configured and starts the Streaming API listener.



13
14
15
16
17
18
# File 'lib/salesforce_streamer/launcher.rb', line 13

def run
  Log.info 'Launching Streamer Services'
  @manager.upsert_topics!
  @server.push_topics = @manager.push_topics
  @server.run
end