Class: SalesforceStreamer::Server
- Inherits:
-
Object
- Object
- SalesforceStreamer::Server
- Defined in:
- lib/salesforce_streamer/server.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#push_topics ⇒ Object
writeonly
Sets the attribute push_topics.
Instance Method Summary collapse
-
#initialize(push_topics: []) ⇒ Server
constructor
A new instance of Server.
- #restart ⇒ Object
- #run ⇒ Object
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
#client ⇒ Object (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
3 4 5 |
# File 'lib/salesforce_streamer/server.rb', line 3 def push_topics=(value) @push_topics = value end |
Instance Method Details
#restart ⇒ Object
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 |
#run ⇒ Object
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 |