Skip to content

Commit

Permalink
Updated with additional requested changes from SDK update
Browse files Browse the repository at this point in the history
Updated with additional changes in clockworklabs/com.clockworklabs.spacetimedbsdk#258
  • Loading branch information
rekhoff committed Mar 3, 2025
1 parent 98b652b commit bf3f7f8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions docs/sdks/c-sharp/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ using SpacetimeDB.Types;
using System.Collections.Concurrent;
```

We will also need to create some global variables that will be explained when we use them later.
We will also need to create some global variables. We'll cover the `Identity` later in the `Save credentials` section. Later we'll also be setting up a second thread for handling user input. In the `Process thread` section we'll use this in the `ConcurrentQueue` to store the commands for that thread.

To `Program.cs`, add:

Expand Down Expand Up @@ -153,7 +153,7 @@ DbConnection ConnectToDB()
.WithToken(AuthToken.Token)
.OnConnect(OnConnected)
.OnConnectError(OnConnectError)
.OnDisconnect(OnDisconnect)
.OnDisconnect(OnDisconnected)
.Build();
return conn;
}
Expand Down Expand Up @@ -198,7 +198,7 @@ To `Program.cs`, add:

```csharp
/// Our `OnDisconnect` callback: print a note, then exit the process.
void OnDisconnect(DbConnection conn, Exception? e)
void OnDisconnected(DbConnection conn, Exception? e)
{
if (e != null)
{
Expand Down Expand Up @@ -321,6 +321,9 @@ To `Program.cs`, add:
/// Our `Message.OnInsert` callback: print new messages.
void Message_OnInsert(EventContext ctx, Message insertedValue)
{
// We are filtering out messages inserted during the subscription being applied,
// since we will be printing those in the OnSubscriptionApplied callback,
// where we will be able to first sort the messages before printing.
if (ctx.Event is not Event<Reducer>.SubscribeApplied)
{
PrintMessage(ctx.Db, insertedValue);
Expand Down

0 comments on commit bf3f7f8

Please sign in to comment.