Class: SplitIoClient::Cache::Stores::LocalhostSplitStore

Inherits:
Object
  • Object
show all
Defined in:
lib/splitclient-rb/cache/stores/localhost_split_store.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(splits_repository, config, status_manager = nil) ⇒ LocalhostSplitStore

Returns a new instance of LocalhostSplitStore.



10
11
12
13
14
# File 'lib/splitclient-rb/cache/stores/localhost_split_store.rb', line 10

def initialize(splits_repository, config, status_manager = nil)
  @splits_repository = splits_repository
  @config = config
  @status_manager = status_manager
end

Instance Attribute Details

#splits_repositoryObject (readonly)

Returns the value of attribute splits_repository.



8
9
10
# File 'lib/splitclient-rb/cache/stores/localhost_split_store.rb', line 8

def splits_repository
  @splits_repository
end

Instance Method Details

#callObject



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/splitclient-rb/cache/stores/localhost_split_store.rb', line 16

def call
  if ENV['SPLITCLIENT_ENV'] == 'test'
    store_splits
  else
    splits_thread

    if defined?(PhusionPassenger)
      PhusionPassenger.on_event(:starting_worker_process) do |forked|
        splits_thread if forked
      end
    end
  end
end