class Expedite::Variant

Attributes

keep_alive[RW]

If set to true, variant will be restarted automatically if it is killed. Defaults to false.

parent[RW]

Name of the parent variant. This allows you to create variants from an existing variant. Defaults to nil.

Public Class Methods

new(parent: nil, keep_alive: false, &after_fork) click to toggle source
parent

Name of parent variant.

after_fork

Block is executed when variant is first preloaded.

# File lib/expedite/variants.rb, line 18
def initialize(parent: nil, keep_alive: false, &after_fork)
  @parent = parent
  @keep_alive = keep_alive
  @after_fork_proc = after_fork
end

Public Instance Methods

after_fork(variant) click to toggle source

Called when variant if first preloaded. This version calls the after_fork block provided in the initializer.

# File lib/expedite/variants.rb, line 27
def after_fork(variant)
  @after_fork_proc&.call(variant)
end