Commit graph

7 commits

Author SHA1 Message Date
Dustin J. Mitchell
8e6d901bf2
Fix new clippy lints 2024-11-30 02:54:38 +00:00
Dustin J. Mitchell
1828a31a24
Make storage transactions specific to a client_id (#67)
Transactions for different client_ids cannot interfere with one another,
so this provides an opportunity for the sort of concurrency that a
mult-client hosting solution might need. For example, a postgres backend
could lock the client row in each transaction.
2024-11-27 00:09:03 -05:00
Dustin J. Mitchell
4029c03479
Support sequential consistency in SQLite implementation (#64)
This is a bit tricky because the `Storage` trait is `Send + Sync`, but
an SQLite connection is neither. Since this is not intended for
large-scale use, the simple solution is just to open a new SQLite
connection for each transaction. More complex alternatives include
thread-local connection pools or a "worker thread" that owns the
connection and communicates with other threads via channels.

This also updates the InMemoryStorage implementation to be a bit more
strict about transactional integrity, which led to a number of test
changes.
2024-11-26 16:22:35 -05:00
Dustin J. Mitchell
75f384d4ec
Log Errors causing ISE's at the error level (#65)
This will cause these to be displayed even without $RUST_LOG set. If
RUST_LOG=debug, the message is printed twice (once at the debug level by
the built-in `Logger` middleware), but this is better than not at all.
2024-11-24 22:29:01 -05:00
Dustin J. Mitchell
50d028f45e
Support a client-id allowlist (#62)
This will support setting up publicly-accessible personal servers,
without also allowing anyone to create a new client.
2024-11-21 21:27:52 -05:00
Dustin J. Mitchell
5ad3b8e8bf
Reorganize the core API (#60) 2024-11-19 18:22:42 -05:00
Dustin J. Mitchell
47ce4c1e3b
Split the server into three crates (#56)
This will make it easier to build variations on the server, or embed it
into larger projects.
2024-11-17 15:12:42 -05:00