Skip to content

Add SANO sample#294

Draft
VegetarianOrc wants to merge 1 commit intomainfrom
amazzeo/sano-sample
Draft

Add SANO sample#294
VegetarianOrc wants to merge 1 commit intomainfrom
amazzeo/sano-sample

Conversation

@VegetarianOrc
Copy link
Copy Markdown
Contributor

NOTE FOR REVIEWERS: This PR is pending the actual release of the API, Server, and Python SDK and will not be merged until those are complete.

Add a sample for using standalone nexus operations.

Comment on lines +47 to +61
# Test sync echo operation (with retry for endpoint propagation)
echo_result = None
for _ in range(30):
try:
echo_result = await nexus_client.execute_operation(
MyNexusService.echo,
EchoInput(message="test-echo"),
id=str(uuid.uuid4()),
schedule_to_close_timeout=timedelta(seconds=10),
)
break
except (RPCError, NexusOperationFailureError):
await asyncio.sleep(0.5)
assert isinstance(echo_result, EchoOutput)
assert echo_result.message == "test-echo"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will remove this retry loop when no longer needed. See this comment from the draft Go SANO sample:

temporalio/samples-go#456 (comment)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant