Use the rpc's status to determine when to exit the request generator thread#5054
Conversation
|
@jonparrott Could the _RequestQueueGenerator be in api_core? |
|
@chemelnucfin possibly, but we should only promote it there once we need to. |
| for response in rpc: | ||
| print(response) | ||
| q.put(...) | ||
| """ |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| """ | ||
| with self._put_lock: | ||
| self._request_queue.put(request) | ||
| self._request_queue.put(request) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| request_generator = _RequestQueueGenerator( | ||
| self._request_queue, initial_request=initial_request) | ||
| rpc = policy.call_rpc(request_generator) | ||
| request_generator.rpc = rpc |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| if self.rpc is not None and not self.rpc.is_active(): | ||
| return True | ||
| else: | ||
| return False |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| assert callback.calls >= 2 | ||
|
|
||
| subscription.close() | ||
|
|
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
LGTM if you add the docstrings for the arguments to |
|
I ran this for several hours without issue. Merging. |
No description provided.