dotnext-library

Guides usage of DotNext 6.6.0 collections and async threading primitives in .NET 10 codebases.

2|Updated Aug 2, 2026
One-click install
npx skills add https://github.com/Arasz/ai-raccoon --skill dotnext-library-arasz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnext-library
Source: https://github.com/Arasz/ai-raccoon/tree/main/.ai-badger/skills/learned/software-development/dotnext-library
Command: npx skills add https://github.com/Arasz/ai-raccoon --skill dotnext-library-arasz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers working in this repository need accurate, version-pinned guidance on the DotNext library to avoid misusing non-reentrant async locks, mixing blocking and async synchronization, or referencing APIs that do not exist in the pinned 6.6.0 release. ## Core Features & Use Cases - Async Locking Guidance: Documents AsyncLock, AsyncExclusiveLock, AsyncReaderWriterLock, and per-object reader/writer extensions from DotNext.Threading, including timeout, cancellation, and concurrency-limit behavior. - Collections Reference: Covers allocation-free helpers like Singleton, Repeat, Slice, Convert, and pool-rented Copy from DotNext.Collections.Generic. - 6.6.0-Specific APIs: Explains AsyncMulticastSequence<T> for single-producer broadcast fan-out and the Listen extension for background IAsyncEnumerable consumption. - Use Case: When replacing a lock plus SemaphoreSlim mix in the watch pipeline, consult this Skill to choose the correct DotNext primitive and avoid deadlocks from reentrant acquisition. ## Quick Start Ask the agent how to add an async-exclusive lock around a shared resource using the DotNext version pinned in Directory.Packages.props.

Frequently Asked Questions about dotnext-library

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use AsyncExclusiveLock in DotNext for async mutual exclusion?

Create an AsyncExclusiveLock instance and call AcquireAsync with a CancellationToken, which returns a ValueTask without blocking the caller thread. Release the lock in a finally block, and optionally use AcquireAsync with a TimeSpan to get a TimeoutException on failure.

What is AsyncMulticastSequence in DotNext 6.6.0?

AsyncMulticastSequence<T> is a single-producer, multi-consumer async broadcast channel implementing IAsyncEnumerable<T>. The producer calls WriteAsync and TryComplete, while each consumer creates its own enumerator via await foreach to receive all events.

Can I mix blocking locks and async locks on the same object in DotNext?

No, blocking locks like Monitor or Lock and DotNext async locks are unaware of each other and must not be mixed on the same object. SemaphoreSlim is the one exception, supporting both blocking and async acquisition through Lock.Semaphore and AsyncLock.Semaphore facades.

Are DotNext async locks reentrant?

No, DotNext async locks are non-reentrant, so recursive acquisition causes a deadlock that is difficult to diagnose. Always structure code so a lock is acquired only once per logical operation.

Which DotNext version does this repository use?

The repository pins DotNext 6.6.0 and DotNext.Threading 6.6.0 in Directory.Packages.props, both compatible with .NET 10. Version changes require an explicit Directory.Packages.props update.

When should I use DotNext instead of Channel for event fan-out?

Use AsyncMulticastSequence when multiple consumers must each receive every event from a single producer. For a single-consumer pipeline, a plain Channel<T> remains the simpler and preferred shape.