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
+20
View File
@@ -0,0 +1,20 @@
package ports
import "context"
// StreamOffsetStore persists the last successfully processed Redis
// Stream entry id per stream. Workers call Load on startup to resume
// from the persisted offset and Save after every successful message
// handling so the next iteration advances past the just-processed
// entry. Lobby uses one logical store with the per-stream key encoded
// inside the implementation.
type StreamOffsetStore interface {
// Load returns the last processed entry id for stream when one is
// stored. The boolean return reports whether a value was present;
// implementations must not return an error for a missing key.
Load(ctx context.Context, stream string) (entryID string, found bool, err error)
// Save stores entryID as the new last processed offset for stream.
// Implementations overwrite any previous value unconditionally.
Save(ctx context.Context, stream, entryID string) error
}