Class: Warg::Executor::Result

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Enumerable
Defined in:
lib/warg.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeResult

Returns a new instance of Result.



1619
1620
1621
1622
1623
# File 'lib/warg.rb', line 1619

def initialize
  @mutex = Mutex.new
  @successful = true
  @value = []
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



1617
1618
1619
# File 'lib/warg.rb', line 1617

def value
  @value
end

Instance Method Details

#failed?Boolean

Returns:

  • (Boolean)


1638
1639
1640
1641
1642
# File 'lib/warg.rb', line 1638

def failed?
  @mutex.synchronize do
    not @successful
  end
end

#successful?Boolean

Returns:

  • (Boolean)


1632
1633
1634
1635
1636
# File 'lib/warg.rb', line 1632

def successful?
  @mutex.synchronize do
    @successful
  end
end

#update(outcome) ⇒ Object



1625
1626
1627
1628
1629
1630
# File 'lib/warg.rb', line 1625

def update(outcome)
  @mutex.synchronize do
    @value << outcome
    @successful &&= outcome.successful?
  end
end