Shaman.SingleThreadSynchronizationContext
Provides a single-threaded synchronization context, which makes it easy to reason about asynchronous code in environments that don't usually provide a synchronization context (for example, console applications).
Install / Use
/learn @antiufo/Shaman.SingleThreadSynchronizationContextREADME
Shaman.SingleThreadSynchronizationContext
Provides a single-threaded SynchronizationContext for console applications.
Usage
using Shaman.Runtime;
static void Main(string args[])
{
SingleThreadSynchronizationContext.Run(async () => MainAsync(args));
}
static async Task MainAsync(string args[])
{
// Tasks awaited here will complete their callbacks on the main thread.
// This makes it easier to reason about async code (by always using coroutines/async, as opposed to real threading).
}
View on GitHub75/100
GitHub Stars14
CategoryDevelopment
Updated1mo ago
Forks1
Languages
C#
Security Score
Audited on Mar 1, 2026
No findings
