Class: Flipper::Adapters::Sync::Synchronizer

Inherits:
Object
  • Object
show all
Defined in:
lib/flipper/adapters/sync/synchronizer.rb

Overview

Public: Given a local and remote adapter, it can update the local to match the remote doing only the necessary enable/disable operations.

Instance Method Summary collapse

Constructor Details

#initialize(local, remote, options = {}) ⇒ Synchronizer

Public: Initializes a new synchronizer.

local - The Flipper adapter to get in sync with the remote. remote - The Flipper adapter that is source of truth that the local

adapter should be brought in line with.

options - The Hash of options.

:instrumenter - The instrumenter used to instrument.


18
19
20
21
22
23
# File 'lib/flipper/adapters/sync/synchronizer.rb', line 18

def initialize(local, remote, options = {})
  @local = local
  @remote = remote
  @instrumenter = options.fetch(:instrumenter, Instrumenters::Noop)
  @raise = options.fetch(:raise, true)
end

Instance Method Details

#callObject

Public: Forces a sync.



26
27
28
# File 'lib/flipper/adapters/sync/synchronizer.rb', line 26

def call
  @instrumenter.instrument("synchronizer_call.flipper") { sync }
end