Limits bandwidth for shared S3 transfers :type leaky_bucket: LeakyBucket :param leaky_bucket: The leaky bucket to use limit bandwidth :type time_utils: TimeUtils :param time_utils: Time utility to use for interacting with time.
(self, leaky_bucket, time_utils=None)
| 60 | |
| 61 | class BandwidthLimiter: |
| 62 | def __init__(self, leaky_bucket, time_utils=None): |
| 63 | """Limits bandwidth for shared S3 transfers |
| 64 | |
| 65 | :type leaky_bucket: LeakyBucket |
| 66 | :param leaky_bucket: The leaky bucket to use limit bandwidth |
| 67 | |
| 68 | :type time_utils: TimeUtils |
| 69 | :param time_utils: Time utility to use for interacting with time. |
| 70 | """ |
| 71 | self._leaky_bucket = leaky_bucket |
| 72 | self._time_utils = time_utils |
| 73 | if time_utils is None: |
| 74 | self._time_utils = TimeUtils() |
| 75 | |
| 76 | def get_bandwith_limited_stream( |
| 77 | self, fileobj, transfer_coordinator, enabled=True |