feat: implement input event system with durable command handling
- Introduced InputEvent model with status tracking (PENDING, PROCESSING, SUCCEEDED, FAILED) and unique request IDs. - Added DatabaseTurnDaemonTransport for sending commands and handling idempotency. - Implemented executeInputEvent function to manage input event lifecycle and error handling. - Created DatabaseTurnDaemonCommandQueue for managing command processing and lease recovery. - Enhanced turn daemon lifecycle to support atomic command execution and error recovery. - Added tests for input event atomicity, command queuing, and error handling scenarios.
This commit is contained in:
@@ -8,11 +8,14 @@ import { runTournamentWorker } from './tournament/worker.js';
|
||||
|
||||
export * from './config.js';
|
||||
export * from './context.js';
|
||||
export * from './inputEventBoundary.js';
|
||||
export * from './router.js';
|
||||
export * from './server.js';
|
||||
export * from './daemon/types.js';
|
||||
export * from './daemon/streamKeys.js';
|
||||
export * from './daemon/transport.js';
|
||||
export * from './daemon/databaseTransport.js';
|
||||
export * from './daemon/idempotentTransport.js';
|
||||
export * from './daemon/inMemoryTransport.js';
|
||||
export * from './daemon/redisTransport.js';
|
||||
export * from './auth/flushStore.js';
|
||||
@@ -51,10 +54,10 @@ if (isMain()) {
|
||||
role === 'battle-sim-worker'
|
||||
? runBattleSimWorker
|
||||
: role === 'auction-worker'
|
||||
? runAuctionWorker
|
||||
: role === 'tournament-worker'
|
||||
? runTournamentWorker
|
||||
: runGameApiServer;
|
||||
? runAuctionWorker
|
||||
: role === 'tournament-worker'
|
||||
? runTournamentWorker
|
||||
: runGameApiServer;
|
||||
run().catch((error) => {
|
||||
console.error('[game-api] failed to start', error);
|
||||
process.exitCode = 1;
|
||||
|
||||
Reference in New Issue
Block a user