feat: game lobby service

This commit is contained in:
Ilia Denisov
2026-04-25 23:20:55 +02:00
committed by GitHub
parent 32dc29359a
commit 48b0056b49
336 changed files with 57074 additions and 1418 deletions
+25
View File
@@ -0,0 +1,25 @@
package ports
import "context"
// RuntimeManager publishes runtime jobs to Runtime Manager via Redis
// Streams. introduces start and stop jobs; future stages may
// extend the surface.
//
// The interface is intentionally narrow: callers pass only the game id.
// Runtime Manager fetches additional context (target engine version,
// turn schedule, etc.) through Lobby's internal HTTP API when it picks
// up the job.
type RuntimeManager interface {
// PublishStartJob enqueues one start job for gameID. Implementations
// must produce one event in the configured runtime start jobs stream
// per call. A zero-error return means the event is durably accepted
// into the stream (Redis XADD succeeded); it does not imply that the
// container has started.
PublishStartJob(ctx context.Context, gameID string) error
// PublishStopJob enqueues one stop job for gameID. Implementations
// must produce one event in the configured runtime stop jobs stream
// per call. The same durability semantics as PublishStartJob apply.
PublishStopJob(ctx context.Context, gameID string) error
}