Skip to content

Add Casino Engine to Event-Driven Architecture Samples - #144

Open
nekzabirov wants to merge 1 commit into
mehdihadeli:mainfrom
nekzabirov:add-casino-engine-eda
Open

Add Casino Engine to Event-Driven Architecture Samples#144
nekzabirov wants to merge 1 commit into
mehdihadeli:mainfrom
nekzabirov:add-casino-engine-eda

Conversation

@nekzabirov

Copy link
Copy Markdown

Summary

Adds nekzabirov/IGaming-Game-Engine to docs/event-driven-architecture.md → Samples.

Why this fits

Casino Engine is a production-grade open-source iGaming/casino engine in Kotlin/Ktor with a non-trivial event-driven layer:

  • Sealed `DomainEvent` hierarchy. Concrete events (`SessionOpened`, `SpinPlaced`, `SpinSettled`, `SpinRolledBack`, `RoundFinished`) are all subtypes of a sealed interface
  • Compiler-checked routing. `RabbitMqEventPublisher.publish` is one exhaustive `when (event)` that maps each event subtype to its routing key + payload — adding a new event without updating the publisher fails compilation
  • Publish-after-commit. Use cases publish events outside the `dbTransaction { }` block; a failed transaction never emits phantom messages
  • Immutable aggregates carry events. `Round.finish()` returns `WithEvents(value, events)` so the use case can drain events post-persist; mutable aggregates extend `AggregateRoot` and call `raise(event)`
  • One mapper per event type. Each event has a dedicated file in `infrastructure/rabbitmq/mapper/` owning its payload + routing key constant

Production-tested on moonbet.casino and 2k.ua. Apache 2.0.

Checklist

  • Separate PR for this category
  • Format matches: `user/repo - Description`
  • Meaningful description with concrete patterns

Production iGaming engine in Kotlin/Ktor with sealed DomainEvent
hierarchy and compile-time-exhaustive RabbitMQ routing.

Link: https://github.com/nekzabirov/IGaming-Game-Engine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant