Class: Dry::Effects::Providers::Fork

Inherits:
Object
  • Object
show all
Defined in:
lib/dry/effects/providers/fork.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#stackObject (readonly)

Returns the value of attribute stack.



7
8
9
# File 'lib/dry/effects/providers/fork.rb', line 7

def stack
  @stack
end

Instance Method Details

#callObject



14
15
16
17
# File 'lib/dry/effects/providers/fork.rb', line 14

def call
  @stack = Frame.stack
  super
end

#forkObject



9
10
11
12
# File 'lib/dry/effects/providers/fork.rb', line 9

def fork
  stack = self.stack.dup
  -> &cont { Frame.spawn_fiber(stack.dup, &cont) }
end