(client, table_name: str, timeout: float = 60.0)
| 37 | endpoint_url=ENDPOINT, |
| 38 | ) |
| 39 | def wait_for_active(client, table_name: str, timeout: float = 60.0) -> None: |
| 40 | deadline = time.monotonic() + timeout |
| 41 | while time.monotonic() < deadline: |
| 42 | resp = client.describe_table(TableName=table_name) |
| 43 | if resp["Table"]["TableStatus"] == "ACTIVE": |
| 44 | return |
| 45 | time.sleep(0.5) |
| 46 | raise TimeoutError(f"Table {table_name} did not become ACTIVE within {timeout}s") |
| 47 | def writer_thread() -> None: |
| 48 | client = make_client() |
| 49 |