Hi! I am doing some experiment on temporal-ruby. I find I cannot create new async_token. keep printing same token.
is there any problem during replaying of my workflow?
module TemporalWorkflow
class PollCommandActivity < Temporal::Activity
retry_policy(
interval: 1,
backoff: 1,
max_attempts: 30,
)
def execute
puts "token #{activity.async_token}"
activity.async
end
end
end
module TemporalWorkflow
class MyWorkflow < Temporal::Workflow
def execute(message:)
loop do
cmd = PollCommandActivity.execute!
break if cmd[:cmd] == "exit"
klass = cmd[:cmd].safe_constantize
cmd[:args] ||= []
cmd[:kwargs] ||= {}
klass.execute!(*cmd[:args], **cmd[:kwargs]) if klass
end
end
end
end