Commit Graph

11 Commits

Author SHA1 Message Date
Mikhail 09abdd5346 Use vectors and commands 2024-05-23 18:02:35 +02:00
Nikita Vilunov 26720a2a08 core: separate the model from the logic implementation (#66)
This separates the core in two layers – the model objects and the `LavinaCore` service. Service is responsible for implementing the application logic and exposing it as core's public API to projections, while the model objects will be independent of each other and responsible only for managing and owning in-memory data.

The model objects include:
1. `Storage` – the open connection to the SQLite DB.
2. `PlayerRegistry` – creates, stores refs to, and stops player actors.
3. `RoomRegistry` – manages active rooms.
4. `DialogRegistry` – manages active dialogs.
5. `Broadcasting` – manages subscriptions of players to rooms on remote cluster nodes.
6. `LavinaClient` – manages HTTP connections to remote cluster nodes.
7. `ClusterMetadata` – read-only configuration of the cluster metadata, i.e. allocation of entities to nodes.

As a result:
1. Model objects will be fully independent of each other, e.g. it's no longer necessary to provide a `Storage` to all registries, or to provide `PlayerRegistry` and `DialogRegistry` to each other.
2. Model objects will no longer be `Arc`-wrapped; instead the whole `Services` object will be `Arc`ed and provided to projections.
3. The public API of `lavina-core` will be properly delimited by the APIs of `LavinaCore`, `PlayerConnection` and so on.
4. `LavinaCore` and `PlayerConnection` will also contain APIs of all features, unlike it was previously with `RoomRegistry` and `DialogRegistry`. This is unfortunate, but it could be improved in future.

Reviewed-on: lavina/lavina#66
2024-05-13 14:32:45 +00:00
Nikita Vilunov 6749103726 scalability: initial support for remote rooms (#61)
Reviewed-on: lavina/lavina#61
2024-05-10 20:44:24 +00:00
Nikita Vilunov f9a6d8bdfc reorder modules a bit 2023-02-04 02:01:49 +01:00
Nikita Vilunov b7995584f0 implement multiple rooms 2023-02-03 23:43:59 +01:00
Nikita Vilunov 03b0ababa7 handle client-side ws error 2023-01-31 22:30:55 +01:00
Nikita Vilunov dd8cf0fbf0 add integration tests for ws, rewrite ws handling 2023-01-31 18:32:35 +01:00
Nikita Vilunov f4dda9fb4b simple broadcast of messages 2023-01-31 13:55:47 +01:00
Nikita Vilunov d6b2289221 prometheus example usage 2023-01-28 00:43:20 +04:00
Nikita Vilunov 0b0c432bb8 add a simple router 2023-01-27 01:11:28 +04:00
Nikita Vilunov 31ffe41929 websocket basic implementation 2023-01-25 16:50:14 +04:00