Skip to content

Conversation

@kristapratico
Copy link
Contributor

No description provided.

@rakshith91
Copy link
Contributor

rakshith91 commented Mar 11, 2021

Do these samples run forever by design? Should we change the samples instead since we don't want users to run for instance, an infinite loop.

What is the behavior of these samples when a user runs the sample?

@yunhaoling
Copy link
Contributor

yunhaoling commented Mar 11, 2021

@rakshith91 , the receiving forever sample is by design.

as far as I know customers usually use eventhub/servicebus as part of a micro server application which constantly pumps and handles messages from the service, and that's why we have the push receiving design in eventhub and the service bus iterator mode (also push-based receiving). so I prefer to keeping most of the receiving sample as they are for customers to start with.

but you have brought a good point and I looked into samples which don't necessarily has to be receiving forever and could be moved into normal section:

  • azure-eventhub
    • authenticate_with_sas_token(_async), we could change to use send as sample
  • azure-servicebus
    • auto_lock_renew(_async), those two don't receive forever

@swathipil , let's update the tickets #16705 #16642 to address those two.

Copy link
Contributor

@rakshith91 rakshith91 left a comment

Choose a reason for hiding this comment

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

@yunhaoling thanks for the explanation.

LGTM

Comment on lines +202 to +205
if isinstance(timeout, tuple):
timeout, pass_if_timeout = timeout
else:
pass_if_timeout = True
Copy link
Member

Choose a reason for hiding this comment

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

@kristapratico , added the default here in order to not change the flow of the current code too much. Made both timeout and pass_if_timeout required params in run_check_call_with_timeout since it seems that there would be no reason both of those wouldn't be passed in. Does that seem reasonable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good to me!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah just realized I can't approve my own PR. I'm ready to merge when you are.

Copy link
Member

Choose a reason for hiding this comment

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

sounds good!

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

Labels

None yet

Projects

None yet

5 participants