atomic-matchmaking
Atomic Matchmaking with Two-Phase Commit
Two-phase commit semantics for match creation that handles player disconnections gracefully.
When to Use This Skill
- Building real-time multiplayer matchmaking
- Need to handle player disconnections during match creation
- Want to avoid orphaned lobbies and stuck players
- Require reliable match notifications
Core Concepts
Matching two players is deceptively hard. Either player can disconnect between being matched and joining. The solution uses two-phase commit:
- Phase 1: Verify both connections are healthy via ping/pong
- Phase 2: Create lobby, send notifications, confirm delivery
- Rollback: On any failure, clean up lobby and re-queue the healthy player
More from dadbodgeoff/drift
sse-streaming
Implement Server-Sent Events (SSE) for real-time updates with automatic reconnection and heartbeats. Use when building live dashboards, notifications, progress indicators, or any feature needing server-to-client push.
78oauth-social-login
Implement OAuth 2.0 social login with Google, GitHub, and other providers. Handles token exchange, user creation, and account linking.
48multi-tenancy
Implement multi-tenant architecture with tenant isolation, data separation, and per-tenant configuration. Supports shared database and schema-per-tenant models.
45deduplication
Event deduplication with canonical selection, reputation scoring, and hash-based grouping for multi-source data aggregation. Handles both ID-based and content-based deduplication.
43fuzzy-matching
Multi-stage fuzzy matching pipeline for entity reconciliation. PostgreSQL trigram pre-filter, salient overlap check, and multi-factor similarity scoring.
40webhook-security
Implement secure webhook handling with signature verification, replay protection, and idempotency. Use when receiving webhooks from third-party services like Stripe, GitHub, Twilio, or building your own webhook system.
37