Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support long poll option for get_workflow_execution_history #325

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

iekundayo
Copy link

@iekundayo iekundayo commented Nov 1, 2024

Seeing the below error when calling await_workflow_result for longer workflows.

await_workflow_result': undefined method 'type' for nil:NilClass (NoMethodError)

The current implementation assumes that the result will always be returned with non-empty events list if the first request doesn't time out from GRPC::DeadlineExceeded. This is not the case when a request is created with the wait_new_event option set to true. Temporal sever treats this as a long poll request and populates the next_page_token to inform that client that it needs to keep polling. This process is repeated until an empty next_page_token is sent alongside the new event.

This PR updates get_workflow_execution_history to align with the official Temporal SDKs (inspired particularly by the Go SDK) by continuously updating and re-issuing the GRPC request to poll until the Temporal server has indicated an error or completed response.

Fixes: #326

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

NoMethodError when await_workflow_result is called for long running workflows
1 participant