()
| 13 | var input_queue = new ConcurrentQueue<(string Command, string Args)>(); |
| 14 | |
| 15 | void 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. |
| 37 | string HOST = Environment.GetEnvironmentVariable("SPACETIMEDB_HOST") ?? "http://localhost:3000"; |
no test coverage detected
searching dependent graphs…