Closed elena-kolevska closed 1 month ago
Attention: Patch coverage is 79.27632%
with 63 lines
in your changes missing coverage. Please review.
Project coverage is 86.08%. Comparing base (
bffb749
) to head (8ba8b41
). Report is 5 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Description
Adds pubsub bidirectional streaming support for the async client, extending the API with the
subscribe
andsubscribe_handler methods
.The
subscribe
method returns aSubscription
object, which allows users to pull messages from the stream by calling thenext_message
method. When done, theclose
method should be called to terminate the subscription and stop receiving messages.The
subscribe_with_handler
method accepts a user callback function that is executed for each message received from the stream. The callback function should return aTopicEventResponseStatus
, indicating whether the message was processed successfully, should be retried, or discarded. Users can return these statuses using theSubscription.SUCCESS
,Subscription.RETRY
, andSubscription.DROP
class properties. The method will automatically manage message acknowledgements based on the returned status. The call tosubscribe_with_handler
method returns a close function, which should be called to terminate the subscription when done.Issue reference
https://github.com/dapr/python-sdk/issues/730
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: