| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| Args: | ||
| ack_id (str): The ack ID. | ||
| """ | ||
| request = types.StreamingPullRequest(ack_ids=[ack_id]) |
| time as there are). | ||
| """ | ||
| return self._client.api.streaming_pull(request_generator, | ||
| options=gax.CallOptions(timeout=600), |
| time.sleep(snooze) | ||
| self.maintain_leases() | ||
|
|
||
| def modify_ack_deadline(self, ack_id, seconds): |
| *.pyc, | ||
| conf.py | ||
|
|
||
| ignore = |
| flow_control (~.pubsub_v1.types.FlowControl): The flow control | ||
| settings. Use this to prevent situations where you are | ||
| inundated with too many messages at once. | ||
| policy_class (class): A class that describes how to handle |
| ~.pubsub_v1.subscriber.consumer.base.BaseConsumer: An instance | ||
| of the defined ``consumer_class`` on the client. | ||
| """ | ||
| subscr = self._policy_class(self, subscription) |
|
|
||
| import six | ||
|
|
||
| __all__ = ( |
| are free to use a different formula. | ||
|
|
||
| The precision of data stored is to the nearest integer. Additionally, | ||
| values outside the range of ``10 <= x <= 600`` are stored as ``10`` or |
| publish_time (datetime): The time that this message was originally | ||
| published. | ||
| """ | ||
| def __init__(self, policy, ack_id, message): |
| # Actually start consuming messages. | ||
| self._consumer.start_consuming() | ||
|
|
||
| # Spawn a helper thread that maintains all of the leases for |
| logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| class Policy(base.BasePolicy): |
| @@ -0,0 +1,121 @@ | |||
| # Copyright 2017, Google Inc. All rights reserved. | |||
| @@ -0,0 +1,155 @@ | |||
| # Copyright 2017, Google Inc. All rights reserved. | |||
It is still in nox.py in the cover session.
…ogle-cloud-python into pubsub-subscriber
| # This doesn't presently deal with exceptions that bubble up | ||
| # through the callback. If there is an error here, the thread will | ||
| # exit and no further queue items will be processed. We could | ||
| # potentially capture errors, log them, and then continue on. |
| @@ -0,0 +1,266 @@ | |||
| # Copyright 2017, Google Inc. All rights reserved. | |||
| abbv_data = abbv_data[0:50] + b'...' | ||
|
|
||
| # Return a useful representation. | ||
| answer = 'Message {\n' |
| receive any given message more than once. | ||
| """ | ||
| time_to_ack = math.ceil(time.time() - self._received_timestamp) | ||
| self._request_queue.put(('ack', { |
| snooze = random.uniform(0.0, p99 * 0.9) | ||
| logger.debug('Snoozing lease management for %f seconds.' % snooze) | ||
| time.sleep(snooze) | ||
| self.maintain_leases() |
| # If we do, we need to stop the stream. | ||
| if self._load >= 1.0: | ||
| self._paused = True | ||
| self.close() |
| # In order to not thrash too much, require us to have passed below | ||
| # the resume threshold (80% by default) of each flow control setting | ||
| # before restarting. | ||
| if self._paused and self._load < self.flow_control.resume_threshold: |
|
Merging this is blocked by CircleCI being hosed. Will try tomorrow morning. |
Sorry, something went wrong.
|
Nevermind -- Pub/Sub passed. It failed on Spanner. Merging now. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Uses #3463 as a base.
This PR implements the Pub/Sub subscriber, which by default uses threading.
The following is yet to be implemented: