Skip to content
This repository was archived by the owner on May 17, 2026. It is now read-only.

Repository files navigation

Moved to Novolis: This library is superseded by `Novolis.Messaging.Channels` from novolis-messaging. This repository is archived; do not add features here.

Frank.Channels.DependencyInjection

A tiny library for having Channel<T> as a Dependency Injection resource in a sane manner

Targets .NET 10 (net10.0). The solution file is SLNX (Frank.Channels.DependencyInjection.slnx). For build commands, SDK notes, and design details, see docs/build-and-test.md and docs/library-design.md. Repository guidance for tools and contributors lives in AGENT.md.


GitHub License NuGet NuGet

GitHub contributors GitHub Release Date - Published_At GitHub last commit GitHub commit activity GitHub pull requests GitHub issues GitHub closed issues


Usage

using Frank.Channels.DependencyInjection;

// Register the channel of a type as a dependency:
services.AddChannel<string>();

// Use the channel as a dependency in various ways:
var channel = provider.GetRequiredService<Channel<string>>();
var channelWriter = provider.GetRequiredService<ChannelWriter<string>>();
var channelReader = provider.GetRequiredService<ChannelReader<string>>();

Advanced usage

using Frank.Channels.DependencyInjection;

// Register the channel of a type as a dependency with a custom configuration:
services.AddChannel<string>(options =>
{
    options.BoundedCapacity = 100;
    options.FullMode = BoundedChannelFullMode.Wait;
    options.SingleReader = true;
    options.SingleWriter = true;
});

// Use the channel as a dependency in various ways:
var channel = provider.GetRequiredService<Channel<string>>();
var channelWriter = provider.GetRequiredService<ChannelWriter<string>>();
var channelReader = provider.GetRequiredService<ChannelReader<string>>();

About

A tiny library for having Channel<T> as a Dependency Injection resource in a sane manner

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages