MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / Main

Function Main

templates/chat-console-cs/Program.cs:15–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13var input_queue = new ConcurrentQueue<(string Command, string Args)>();
14
15void Main()
16{
17 // Initialize the `AuthToken` module
18 AuthToken.Init(".spacetime_csharp_quickstart");
19 // Builds and connects to the database
20 DbConnection? conn = null;
21 conn = ConnectToDB();
22 // Registers callbacks to run in response to database events.
23 RegisterCallbacks(conn);
24 // Declare a threadsafe cancel token to cancel the process loop
25 var cancellationTokenSource = new CancellationTokenSource();
26 // Spawn a thread to call process updates and process commands
27 var thread = new Thread(() => ProcessThread(conn, cancellationTokenSource.Token));
28 thread.Start();
29 // Handles CLI input
30 InputLoop();
31 // This signals the ProcessThread to stop
32 cancellationTokenSource.Cancel();
33 thread.Join();
34}
35
36/// The URI of the SpacetimeDB instance hosting our chat module.
37string HOST = Environment.GetEnvironmentVariable("SPACETIMEDB_HOST") ?? "http://localhost:3000";

Callers 1

Program.csFile · 0.70

Calls 6

ConnectToDBFunction · 0.85
RegisterCallbacksFunction · 0.85
ProcessThreadFunction · 0.85
InputLoopFunction · 0.85
InitMethod · 0.45
StartMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…