Class: AWS::Flow::WorkflowFuture

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

Overview

A future provided by a [AWS::SimpleWorkflow::WorkflowExecution](docs.aws.amazon.com/AWSRubySDK/latest/AWS/SimpleWorkflow/WorkflowExecution.html).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(workflow_execution) ⇒ WorkflowFuture

Creates a new workflow future.

Parameters:



92
93
94
95
# File '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

#method_missing(method_name, *args, &block) ⇒ Object

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 '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

#_workflow_executionObject

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 '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

#return_valueObject

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 '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

#is_flow_future?Boolean

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

Returns:



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

def is_flow_future?
  true
end

#workflow_executionMinimalWorkflowExecution

Gets the current value of the workflow execution.

Returns:



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

def workflow_execution
  @_workflow_execution
end