Method: Debtor#resource

Defined in:
lib/arboretum/debtor.rb

#resourceObject



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/arboretum/debtor.rb', line 24

def resource
  begin
    if locked?
      @creditors << Fiber.current
      Fiber.yield
    end
  rescue FiberError
    puts "Warning: Tried to yield the root Fiber on a locked resource call. Returning resource anyways..."
  end
  @resource
end