SkillAgentSearch skills...

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.SingleThreadSynchronizationContext
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

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 GitHub
GitHub Stars14
CategoryDevelopment
Updated1mo ago
Forks1

Languages

C#

Security Score

75/100

Audited on Mar 1, 2026

No findings