[WebPubSub] Support invoke_event for webpubsub client#45450
Open
MoChilia wants to merge 9 commits intoAzure:mainfrom
Open
[WebPubSub] Support invoke_event for webpubsub client#45450MoChilia wants to merge 9 commits intoAzure:mainfrom
invoke_event for webpubsub client#45450MoChilia wants to merge 9 commits intoAzure:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a preview invoke_event request/response API to WebPubSubClient (sync + async), enabling upstream-event invocation with correlated invokeResponse handling, plus associated protocol/model updates and unit tests.
Changes:
- Introduces new invoke/cancel/invokeResponse message models and invocation management helpers.
- Adds
invoke_eventimplementation to sync and async clients with correlation and error mapping viaInvocationError. - Updates unit tests/protocol parsing and README documentation for the new preview feature.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/webpubsub/azure-messaging-webpubsubclient/tests/test_unit.py | Adds protocol write/parse coverage for invoke/cancel/invokeResponse frames. |
| sdk/webpubsub/azure-messaging-webpubsubclient/tests/test_invocation_manager.py | Adds sync InvocationManager unit tests. |
| sdk/webpubsub/azure-messaging-webpubsubclient/tests/test_invocation_manager_async.py | Adds async InvocationManagerAsync unit tests. |
| sdk/webpubsub/azure-messaging-webpubsubclient/azure/messaging/webpubsubclient/models/_models.py | Adds new invoke-related models, protocol parse/write support, and invocation managers/errors. |
| sdk/webpubsub/azure-messaging-webpubsubclient/azure/messaging/webpubsubclient/models/_enums.py | Extends upstream message types to include invoke/cancelInvocation. |
| sdk/webpubsub/azure-messaging-webpubsubclient/azure/messaging/webpubsubclient/models/init.py | Exposes new public result/error types and InvocationError. |
| sdk/webpubsub/azure-messaging-webpubsubclient/azure/messaging/webpubsubclient/aio/_client.py | Implements async invoke_event, integrates invokeResponse dispatch and disconnect rejection. |
| sdk/webpubsub/azure-messaging-webpubsubclient/azure/messaging/webpubsubclient/_client.py | Implements sync invoke_event, integrates invokeResponse dispatch and disconnect rejection. |
| sdk/webpubsub/azure-messaging-webpubsubclient/README.md | Documents invoke_event usage (preview). |
sdk/webpubsub/azure-messaging-webpubsubclient/azure/messaging/webpubsubclient/aio/_client.py
Show resolved
Hide resolved
sdk/webpubsub/azure-messaging-webpubsubclient/azure/messaging/webpubsubclient/_client.py
Show resolved
Hide resolved
sdk/webpubsub/azure-messaging-webpubsubclient/azure/messaging/webpubsubclient/aio/_client.py
Show resolved
Hide resolved
sdk/webpubsub/azure-messaging-webpubsubclient/azure/messaging/webpubsubclient/models/_models.py
Show resolved
Hide resolved
sdk/webpubsub/azure-messaging-webpubsubclient/azure/messaging/webpubsubclient/models/_models.py
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a preview
invoke_eventAPI to the Web PubSub client SDK, enabling request-response style communication with upstream event handlers. The client sends an invoke request, awaits the correlatedinvokeResponse, and returns the result, or raisesInvocationErroron failure/timeout.All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines