Skip to content

Commit

Permalink
docs: Add a game server example (#9)
Browse files Browse the repository at this point in the history
some other minor changes:

* fix: Use temporary version of async-trait and update sqlx
* chore: Replace Makefile with just
* fix: Fix test in rio-macros
  • Loading branch information
rcelha authored Sep 23, 2023
1 parent fdb6fe8 commit b2cf97e
Show file tree
Hide file tree
Showing 37 changed files with 6,246 additions and 408 deletions.
254 changes: 139 additions & 115 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repository = "https://github.com/rcelha/rio-rs"
description = "Distributed stateful service framework"

[dependencies]
async-trait = "0.1.57"
async-trait = { git = "https://github.com/rcelha/async-trait", branch = "feature_add_sync_option_for_future" }
bincode = "1.3.3"
dashmap = "5.4.0"
rand = "0.8"
Expand Down Expand Up @@ -40,7 +40,7 @@ state = "0.5.2"
bb8 = "0.7.1"

# DB
sqlx = { version = "0.5", features = [
sqlx = { version = "0.6", features = [
"runtime-tokio-native-tls",
"sqlite",
"postgres",
Expand Down
56 changes: 0 additions & 56 deletions Makefile

This file was deleted.

35 changes: 29 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ impl Handler<HelloMessage> for HelloWorldService {

To run your application you need to spin up your servers, the `Server`

<!-- TODO: Include example of other databases -->

```rust
use rio_rs::prelude::*;
use rio_rs::cluster::storage::sql::{SqlMembersStorage};
Expand Down Expand Up @@ -120,7 +122,7 @@ async fn main() {
);

// Run the server
// server.serve().await;
// server.run().await;
}
```

Expand Down Expand Up @@ -203,21 +205,42 @@ There are a few things that must be done before v0.1.0:
- [x] Public API renaming
- [x] Reduce Boxed objects
- [x] Create a Server builder
- [ ] Harden networking (only happy path is implemented)
- [x] Use tower for client
- [x] Remove unwrap from client and server services
- [x] Improve `upsert` performance
- [ ] Add more extensive tests to client/server integration
- [ ] Remove the need to pass the StateSaver to `ObjectStateManager::save_state`
- [ ] Error and panic handling on life cycle hooks (probably kill the object)
- [ ] Handle panics on messages handling
- [ ] Include registry configuration in Server builder
- [ ] Remove need to use `add_static_fn(FromId::from_id)`
- [ ] Create a getting started tutorial
- [ ] Cargo init
- [ ] Add deps (rio-rs, tokio, async_trait, serde, sqlx - optional)
- [ ] Write a server
- [ ] Write a client
- [ ] Add service and messages
- [ ] Cargo run --bin server
- [ ] Cargo run --bin client
- [ ] Life cycle
- [ ] Life cycle depends on app_data(StateLoader + StateSaver)
- [ ] Cargo test?
- [ ] Make all sql statements compatible with sqlite, mysql and pgsql
- [ ] Add more extensive tests to client/server integration
- [ ] Client/server keep alive
- [ ] Reduce static lifetimes
- [ ] Increase public API test coverage
- [ ] 100% documentation of public API
- [ ] Pub/sub
- [ ] Placement strategies
- [ ] Dockerized examples
- [ ] Add pgsql jsonb support
- [ ] Add all SQL storage behind a feature flag (sqlite, mysql, pgsql, etc)
- [ ] Supervision
- [ ] Ephemeral objects (aka regular actors)
- [ ] Code of conduct
- [ ] Remove magic numbers
- [ ] Object TTL
- [x] Support service background task
- [ ] Matrix test with different backends
- [ ] Support 'typed' message/response on client
- [ ] Support ephemeral port
- [-] Examples covering most use cases
- [ ] Background async task on a service
- [x] Background blocking task on a service (_see_ [examples/black-jack]())
3 changes: 3 additions & 0 deletions examples/black-jack/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/target
/perf.data*
/flamegraph.svg
Loading

0 comments on commit b2cf97e

Please sign in to comment.