feat: implement real-time event handling and SSE support; add event publishing and subscription mechanisms

This commit is contained in:
2026-01-17 01:39:06 +00:00
parent f3c0f492be
commit 56b1c40642
13 changed files with 473 additions and 13 deletions
+12
View File
@@ -0,0 +1,12 @@
import type { RedisConnector } from '@sammo-ts/infra';
import { buildGameEventChannel, type RealtimeEvent } from '@sammo-ts/common';
// 게임 서버의 실시간 이벤트를 Redis pub/sub 채널로 송신한다.
export const publishRealtimeEvent = async (
redis: RedisConnector['client'],
profileName: string,
event: RealtimeEvent
): Promise<void> => {
const channel = buildGameEventChannel(profileName);
await redis.publish(channel, JSON.stringify(event));
};