Class: AWS::Flow::WorkflowFuture

Inherits:
Object
  • Object
show all
Defined in:
aws-flow-ruby/aws-flow/lib/aws/decider/workflow_client.rb

Overview

A future provided by a AWS::SimpleWorkflow::WorkflowExecution.

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (WorkflowFuture) initialize(workflow_execution)

Creates a new workflow future.

Parameters:



92
93
94
95
# File 'aws-flow-ruby/aws-flow/lib/aws/decider/workflow_client.rb', line 92

def initialize(workflow_execution)
  @_workflow_execution = workflow_execution.dup
  @return_value = Future.new
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

- (Object) method_missing(method_name, *args, &block)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



106
107
108
# File 'aws-flow-ruby/aws-flow/lib/aws/decider/workflow_client.rb', line 106

def method_missing(method_name, *args, &block)
  @return_value.send(method_name, *args, &block)
end

Instance Attribute Details

- (Object) _workflow_execution

A MinimalWorkflowExecution instance that this future belongs to.



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'aws-flow-ruby/aws-flow/lib/aws/decider/workflow_client.rb', line 83

class WorkflowFuture
  attr_accessor :_workflow_execution, :return_value


  # Creates a new workflow future.
  #
  # @param workflow_execution
  #   The {MinimalWorkflowExecution} to assign to this future.
  #
  def initialize(workflow_execution)
    @_workflow_execution = workflow_execution.dup
    @return_value = Future.new
  end

  # Determines whether the object is a flow future. The contract is that flow futures must have a `get` method.
  #
  # @return
  #   Always returns `true` for a {WorkflowFuture} object.
  def is_flow_future?
    true
  end

  # @api private
  def method_missing(method_name, *args, &block)
    @return_value.send(method_name, *args, &block)
  end

  # Gets the current value of the workflow execution.
  #
  # @return {MinimalWorkflowExecution}
  #   The workflow execution that this future belongs to.
  #
  def workflow_execution
    @_workflow_execution
  end
end

- (Object) return_value

The return value of the future.



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'aws-flow-ruby/aws-flow/lib/aws/decider/workflow_client.rb', line 83

class WorkflowFuture
  attr_accessor :_workflow_execution, :return_value


  # Creates a new workflow future.
  #
  # @param workflow_execution
  #   The {MinimalWorkflowExecution} to assign to this future.
  #
  def initialize(workflow_execution)
    @_workflow_execution = workflow_execution.dup
    @return_value = Future.new
  end

  # Determines whether the object is a flow future. The contract is that flow futures must have a `get` method.
  #
  # @return
  #   Always returns `true` for a {WorkflowFuture} object.
  def is_flow_future?
    true
  end

  # @api private
  def method_missing(method_name, *args, &block)
    @return_value.send(method_name, *args, &block)
  end

  # Gets the current value of the workflow execution.
  #
  # @return {MinimalWorkflowExecution}
  #   The workflow execution that this future belongs to.
  #
  def workflow_execution
    @_workflow_execution
  end
end

Instance Method Details

- (Boolean) is_flow_future?

Determines whether the object is a flow future. The contract is that flow futures must have a get method.

Returns:



101
102
103
# File 'aws-flow-ruby/aws-flow/lib/aws/decider/workflow_client.rb', line 101

def is_flow_future?
  true
end

- (MinimalWorkflowExecution) workflow_execution

Gets the current value of the workflow execution.

Returns:



115
116
117
# File 'aws-flow-ruby/aws-flow/lib/aws/decider/workflow_client.rb', line 115

def workflow_execution
  @_workflow_execution
end