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:
parent
6c8e5561dc
commit
52cd3e630e
|
|
@ -161,8 +161,8 @@ pub async fn record_event(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Persists platform events to the `event` table and broadcasts via WebSocket.
|
/// Translates a PlatformEvent to an EventInsert and delegates to record_event.
|
||||||
pub async fn persist_and_broadcast(
|
pub async fn record_platform_event(
|
||||||
event: &PlatformEvent,
|
event: &PlatformEvent,
|
||||||
pool: &sqlx::PgPool,
|
pool: &sqlx::PgPool,
|
||||||
ws_manager: &WebSocketManager,
|
ws_manager: &WebSocketManager,
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ impl PlatformContext {
|
||||||
let cm = self.connection_manager.clone();
|
let cm = self.connection_manager.clone();
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
// Persist + broadcast.
|
// 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.
|
// Connection management side effects.
|
||||||
match &event {
|
match &event {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue