Class: SplitIoClient::Engine::SyncManager
- Inherits:
-
Object
- Object
- SplitIoClient::Engine::SyncManager
- Defined in:
- lib/splitclient-rb/engine/sync_manager.rb
Instance Method Summary collapse
-
#initialize(repositories, api_key, config, synchronizer) ⇒ SyncManager
constructor
A new instance of SyncManager.
- #start ⇒ Object
Constructor Details
#initialize(repositories, api_key, config, synchronizer) ⇒ SyncManager
Returns a new instance of SyncManager.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/splitclient-rb/engine/sync_manager.rb', line 6 def initialize( repositories, api_key, config, synchronizer ) @synchronizer = synchronizer notification_manager_keeper = SplitIoClient::SSE::NotificationManagerKeeper.new(config) do |manager| manager.on_action { |action| process_action(action) } end @sse_handler = SplitIoClient::SSE::SSEHandler.new( config, @synchronizer, repositories[:splits], repositories[:segments], notification_manager_keeper ) do |handler| handler.on_action { |action| process_action(action) } end @push_manager = PushManager.new(config, @sse_handler, api_key) @sse_connected = Concurrent::AtomicBoolean.new(false) @config = config end |
Instance Method Details
#start ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/splitclient-rb/engine/sync_manager.rb', line 31 def start if @config.streaming_enabled start_stream start_stream_forked if defined?(PhusionPassenger) elsif @config.standalone? start_poll end end |