class Flipper::Adapters::DualWrite

Attributes

name[R]

Public: The name of the adapter.

Public Class Methods

new(local, remote, options = {}) click to toggle source

Public: Build a new sync instance.

local - The local flipper adapter that should serve reads. remote - The remote flipper adapter that writes should go to first (in

addition to the local adapter).
# File lib/flipper/adapters/dual_write.rb, line 14
def initialize(local, remote, options = {})
  @name = :dual_write
  @local = local
  @remote = remote
end

Public Instance Methods

add(feature) click to toggle source
# File lib/flipper/adapters/dual_write.rb, line 36
def add(feature)
  result = @remote.add(feature)
  @local.add(feature)
  result
end
clear(feature) click to toggle source
# File lib/flipper/adapters/dual_write.rb, line 48
def clear(feature)
  result = @remote.clear(feature)
  @local.clear(feature)
  result
end
disable(feature, gate, thing) click to toggle source
# File lib/flipper/adapters/dual_write.rb, line 60
def disable(feature, gate, thing)
  result = @remote.disable(feature, gate, thing)
  @local.disable(feature, gate, thing)
  result
end
enable(feature, gate, thing) click to toggle source
# File lib/flipper/adapters/dual_write.rb, line 54
def enable(feature, gate, thing)
  result = @remote.enable(feature, gate, thing)
  @local.enable(feature, gate, thing)
  result
end
features() click to toggle source
# File lib/flipper/adapters/dual_write.rb, line 20
def features
  @local.features
end
get(feature) click to toggle source
# File lib/flipper/adapters/dual_write.rb, line 24
def get(feature)
  @local.get(feature)
end
get_all() click to toggle source
# File lib/flipper/adapters/dual_write.rb, line 32
def get_all
  @local.get_all
end
get_multi(features) click to toggle source
# File lib/flipper/adapters/dual_write.rb, line 28
def get_multi(features)
  @local.get_multi(features)
end
remove(feature) click to toggle source
# File lib/flipper/adapters/dual_write.rb, line 42
def remove(feature)
  result = @remote.remove(feature)
  @local.remove(feature)
  result
end