dhiaayachi / temporal

Temporal service
https://docs.temporal.io
MIT License
0 stars 0 forks source link

Support non blocking PollWorkflowExecutionUpdate #252

Open dhiaayachi opened 3 weeks ago

dhiaayachi commented 3 weeks ago

This may be able to be done by just adding a bool non_blocking option to PollWorkflowExecutionUpdateRequest (or maybe you can just assume unset or “admitted” wait stage implies non blocking) and properly including update details/status on the poll response (for all calls, blocking or not)

dhiaayachi commented 1 week ago

Thank you for reporting this issue! We appreciate your feedback.

It seems you are requesting a feature that would add a non_blocking option to the PollWorkflowExecutionUpdateRequest or infer non-blocking behavior based on the wait stage. This would allow for updates to be included in the poll response even when not blocking.

While this is not currently supported, you can achieve a similar outcome by using the WorkflowClient.getWorkflowExecutionInfo method, which retrieves information about a workflow execution.

Feel free to provide more details about your use case, and we can explore other potential workarounds together.

dhiaayachi commented 1 week ago

Thank you for your suggestion! We appreciate your feedback on how to improve the Temporal workflow execution polling experience.

While we don't have a non_blocking option for PollWorkflowExecutionUpdateRequest at the moment, you can achieve similar behavior by:

  1. Using a separate thread/goroutine for polling: You can initiate the polling process in a separate thread/goroutine, allowing your main thread to continue with other tasks. When the polling thread receives a response, it can update the workflow execution details or trigger the appropriate actions.

  2. Using PollWorkflowExecutionUpdateRequest with a short timeout: You can use PollWorkflowExecutionUpdateRequest with a short timeout, checking the response frequently to see if there are any updates. This approach allows your application to handle other tasks while still monitoring for workflow updates.

These approaches might help you achieve a non-blocking workflow execution polling experience. We will consider your suggestion for future enhancements to the Temporal API.

dhiaayachi commented 1 week ago

Thank you for your feature request!

It's a great suggestion to add a non-blocking option to PollWorkflowExecutionUpdateRequest. This would allow clients to get updates on the status of a workflow without blocking the thread.

While this feature is not currently available, there is a workaround you can consider. You can use a separate thread or a different process to poll for updates, so that the main thread is not blocked.

We appreciate your feedback and will consider adding this feature in the future.