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

Count Workflow Executions #203

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

Conversation

calum-stripe
Copy link
Contributor

@calum-stripe calum-stripe commented Nov 1, 2022

Summary

This PR fixes implements the count_workflow_executions function and adds an integration test to check this works!

Test Plan

# unit test
bundle exec rspec spec/

# integration test
cd examples
(terminal 1) ./bin/worker
(terminal 2) USE_ENCRYPTION=1 ./bin/worker
(terminal 3) bundle exec rspec spec/integration

lib/temporal.rb Outdated
@@ -29,7 +29,8 @@ module Temporal
:fail_activity,
:list_open_workflow_executions,
:list_closed_workflow_executions,
:query_workflow_executions
:query_workflow_executions,
count_workflow_executions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a syntax error 👁️

@@ -409,6 +409,10 @@ def query_workflow_executions(namespace, query, next_page_token: nil, max_page_s
Temporal::Workflow::Executions.new(connection: connection, status: :all, request_options: { namespace: namespace, query: query, next_page_token: next_page_token, max_page_size: max_page_size }.merge(filter))
end

def count_workflow_executions(namespace, query)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that other SDKs actually have this method exposed. With that in mind, let's not add it to the Client, but instead only expose it on the connection itself and possibly make the connection public. This way you can access the low-level API if needed, but we're not committing to supporting it via the high-level classes

namespace: namespace,
query: query
)
client.count_workflow_executions(request)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait, this is also missing an end. Something is not right with this PR

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.

None yet

2 participants