| 116 | yield item |
| 117 | |
| 118 | def parse_runstep_responses(self, responses): |
| 119 | chunks = [] |
| 120 | response_head = None |
| 121 | has_next = True |
| 122 | for response in responses: |
| 123 | if response.HasField("head"): |
| 124 | response_head = response |
| 125 | else: |
| 126 | if not chunks or not has_next: |
| 127 | chunks.append(response.body.chunk) |
| 128 | else: |
| 129 | chunks[-1] += response.body.chunk |
| 130 | has_next = response.body.has_next |
| 131 | cursor = 0 |
| 132 | for op_result in response_head.head.results: |
| 133 | if op_result.meta.has_large_result: |
| 134 | op_result.result = chunks[cursor] |
| 135 | cursor += 1 |
| 136 | return response_head.head |
| 137 | |
| 138 | |
| 139 | def handle_grpc_error_with_retry(fn, retry=True): |