clockworklabs / SpacetimeDB

Multiplayer at the speed of light
https://spacetimedb.com
Other
4.41k stars 110 forks source link

Extend `ClientConnectionSender` with flag `--light-tx-update` #1789

Closed Centril closed 3 weeks ago

Centril commented 1 month ago

Provide a lighter version of TransactionUpdate if the flag is passed:

pub enum ServerMessage<F: WebsocketFormat> {
    InitialSubscription(InitialSubscription<F>),
    TransactionUpdate(TransactionUpdate<F>),
    IdentityToken(IdentityToken),
    OneOffQueryResponse(OneOffQueryResponse<F>),

    TransactionUpdateLight(TransactionUpdateLight<F>),
}

pub struct TransactionUpdateLight<F: WebsocketFormat> {
    request_id: u32,
    /// The status of the transaction. Contains the updated rows, if successful.
    pub status: DatabaseUpdate<F>,
}