Class: SalesforceStreamer::Server

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(push_topics: []) ⇒ Server

Returns a new instance of Server.


6
7
8
# File 'lib/salesforce_streamer/server.rb', line 6

def initialize(push_topics: [])
  @push_topics = push_topics
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.


4
5
6
# File 'lib/salesforce_streamer/server.rb', line 4

def client
  @client
end

#push_topics=(value) ⇒ Object (writeonly)

Sets the attribute push_topics

Parameters:

  • value

    the value to set the attribute push_topics to.


3
4
5
# File 'lib/salesforce_streamer/server.rb', line 3

def push_topics=(value)
  @push_topics = value
end

Instance Method Details

#restartObject


17
18
19
20
21
# File 'lib/salesforce_streamer/server.rb', line 17

def restart
  Log.info 'Restarting server'
  reset_client
  EM.next_tick { subscribe }
end

#runObject


10
11
12
13
14
15
# File 'lib/salesforce_streamer/server.rb', line 10

def run
  Log.info 'Starting server'
  catch_signals
  reset_client
  EM.run { subscribe }
end