| 208 | |
| 209 | |
| 210 | class StreamEventCaptureTrackerAsync( |
| 211 | PreStartStreamHookAsync, PostStreamItemHookAsync, PostEndStreamHook |
| 212 | ): |
| 213 | def __init__(self): |
| 214 | self.pre_start_stream_calls = [] |
| 215 | self.post_stream_item_calls = [] |
| 216 | self.post_end_stream_calls = [] |
| 217 | |
| 218 | async def pre_start_stream( |
| 219 | self, |
| 220 | *, |
| 221 | action: str, |
| 222 | sequence_id: int, |
| 223 | app_id: str, |
| 224 | partition_key: Optional[str], |
| 225 | **future_kwargs: Any, |
| 226 | ): |
| 227 | self.pre_start_stream_calls.append((action, locals())) |
| 228 | |
| 229 | async def post_stream_item( |
| 230 | self, |
| 231 | *, |
| 232 | item: Any, |
| 233 | item_index: int, |
| 234 | stream_initialize_time: datetime.datetime, |
| 235 | first_stream_item_start_time: datetime.datetime, |
| 236 | action: str, |
| 237 | sequence_id: int, |
| 238 | app_id: str, |
| 239 | partition_key: Optional[str], |
| 240 | **future_kwargs: Any, |
| 241 | ): |
| 242 | self.post_stream_item_calls.append((action, locals())) |
| 243 | |
| 244 | def post_end_stream( |
| 245 | self, |
| 246 | *, |
| 247 | action: str, |
| 248 | sequence_id: int, |
| 249 | app_id: str, |
| 250 | partition_key: Optional[str], |
| 251 | **future_kwargs: Any, |
| 252 | ): |
| 253 | self.post_end_stream_calls.append((action, locals())) |
| 254 | |
| 255 | |
| 256 | class CallCaptureTracker( |
no outgoing calls