clockworklabs / SpacetimeDB

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

"Builtin reducer" callbacks #671

Open kim opened 9 months ago

kim commented 9 months ago

The generated Rust code dispatching reducer events currently does not know about "builtin" reducer names such as __identity_connected__, and emits a log line at ERROR level when it encounters it.

It is unclear if it should not receive those events in the first place, ignore them, or dispatch them to some callback function.

jdetter note: I created a ticket for this in the C# SDK: https://github.com/clockworklabs/spacetimedb-csharp-sdk/issues/102

gefjon commented 3 months ago

Likely we should have a callback on_identity_connected or on_identity_disconnected, and corresponding ReducerEvent variants. The SDK should not generate code to invoke these reducers, only to listen for them.

Open questions:

gefjon commented 1 month ago

Moving ticket to "in review" as this is addressed by the API stability proposal