I have the following SWF Workflow which asynchronously calls 2 activities, gets their results, and passes that to the third activity:
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, arg2)
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 not a string URL, but is instead:
#<AWS::Flow::Utilities::AddressableFuture:0x007fe87243d908>
I have not been able to figure out how to get the result from that AddressableFuture
.
I tried writing some wrapper code that works both with and without retry logic:
def get_return_value(future)
value = future.get
if value.kind_of? AWS::Flow::Utilities::AddressableFuture
value = value.return_value.get
end
return value
end
and then:
a_url = get_return_value(a_future)
b_url = get_return_value(b_future)
... but that just goes in circles and still doesn't get the results.
Any ideas on how I can get the return value from both activities, and pass that to the third activity, when the activities have retry logic?