Method: Faulty#initialize

Defined in:
lib/faulty.rb

#initialize(**options) {|Options| ... } ⇒ Faulty

Create a new Faulty instance

Note, the process of creating a new instance is not thread safe, so make sure instances are setup during your application's initialization phase.

For the most part, Faulty instances are independent, however for some cache and storage backends, you will need to ensure that the cache keys and circuit names don't overlap between instances. For example, if using the Faulty::Storage::Redis storage backend, you should specify different key prefixes for each instance.

Parameters:

  • options (Hash)

    Attributes for Options

Yields:

  • (Options)

    For setting options in a block

See Also:


229
230
231
232
# File 'lib/faulty.rb', line 229

def initialize(**options, &block)
  @options = Options.new(options, &block)
  @registry = CircuitRegistry.new(circuit_options)
end