feat(event): add single-thread event publisher with retry and cleanup

This commit is contained in:
2026-07-10 12:08:24 +08:00
parent 96ec929378
commit 0e6f7a3072
4 changed files with 143 additions and 0 deletions

View File

@@ -96,6 +96,15 @@ class EventStore:
attempt_count=row["attempt_count"],
)
def get(self, event_id: str) -> Optional[OutboundEvent]:
row = self._connection().execute(
"SELECT id, event_type, payload, status, attempt_count FROM outbound_events WHERE id = ?",
(event_id,),
).fetchone()
if row is None:
return None
return self._row_to_event(row)
def mark_delivered(self, event_id: str) -> None:
now = self._now().isoformat()
with self._connection() as conn: