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:



239
240
241
242
# File 'lib/faulty.rb', line 239

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