Rename persist_and_broadcast to record_platform_event

After record_event became the primitive for INSERT + broadcast + tracing,
persist_and_broadcast no longer persists or broadcasts directly — it
translates a PlatformEvent into an EventInsert and delegates. The new
name makes the layering explicit (record_event is the primitive,
record_platform_event is the PlatformEvent translator).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
caoqianming 2026-04-22 08:33:28 +08:00
parent 6c8e5561dc
commit 52cd3e630e
2 changed files with 3 additions and 3 deletions

View File

@ -161,8 +161,8 @@ pub async fn record_event(
}
}
/// Persists platform events to the `event` table and broadcasts via WebSocket.
pub async fn persist_and_broadcast(
/// Translates a PlatformEvent to an EventInsert and delegates to record_event.
pub async fn record_platform_event(
event: &PlatformEvent,
pool: &sqlx::PgPool,
ws_manager: &WebSocketManager,

View File

@ -35,7 +35,7 @@ impl PlatformContext {
let cm = self.connection_manager.clone();
tokio::spawn(async move {
// Persist + broadcast.
crate::event::persist_and_broadcast(&event, &pool, &ws_manager).await;
crate::event::record_platform_event(&event, &pool, &ws_manager).await;
// Connection management side effects.
match &event {