Skip to content
This repository was archived by the owner on Jan 10, 2019. It is now read-only.
This repository was archived by the owner on Jan 10, 2019. It is now read-only.

[Question] Why does future.get return 2 different things depending on retry logic? #48

@pas256

Description

@pas256

I have the following code which asynchronously calls 2 activities and gets their results:

    a_future = Future.new.set
    b_future = Future.new.set

    a_future = activity.send_async(:a_activity, arg1)
    b_future = activity.send_async(:b_activity, arg1)

    wait_for_all(a_future, b_future)
    a_url = a_future.get
    b_url = b_future.get

    activity.c_activity(arg1, a_url, b_url)

When running this as is, I get the expected return value (which in this case is a URL) in a_url and b_url.

However, when I add retry logic to the activities

  activity :a_activity, :b_activity, :c_activity do
    {
      version: "0.0.1",
      default_task_list: $activity_task_list,
      default_task_schedule_to_start_timeout: 30,
      default_task_start_to_close_timeout: 30,
      # ADD the next 3 lines for retry logic
      exponential_retry: {
        maximum_attempts: 5,
      }
    }
  end

The value from a_future.get is now

#<AWS::Flow::Utilities::AddressableFuture:0x007fe87243d908>

That seems weird to me. Now if I want the same Workflow code to understand Activities with and without retry logic, I need a wrapper method to extract the real return value if an AddressableFuture is returned.

Have I missed something?

Also, is there a better place to ask this question?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions