![]() |
VOOZH | about |
dotnet add package System.Threading.Tasks.Dataflow --version 10.0.9
NuGet\Install-Package System.Threading.Tasks.Dataflow -Version 10.0.9
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="10.0.9" />
<PackageVersion Include="System.Threading.Tasks.Dataflow" Version="10.0.9" />Directory.Packages.props
<PackageReference Include="System.Threading.Tasks.Dataflow" />Project file
paket add System.Threading.Tasks.Dataflow --version 10.0.9
#r "nuget: System.Threading.Tasks.Dataflow, 10.0.9"
#:package System.Threading.Tasks.Dataflow@10.0.9
#addin nuget:?package=System.Threading.Tasks.Dataflow&version=10.0.9Install as a Cake Addin
#tool nuget:?package=System.Threading.Tasks.Dataflow&version=10.0.9Install as a Cake Tool
Provides dataflow components that are collectively referred to as the TPL Dataflow Library. This dataflow model promotes actor-based programming by providing in-process message passing for coarse-grained dataflow and pipelining tasks.
BufferBlock, ActionBlock, TransformBlock).This sample demonstrates a dataflow pipeline that downloads the book "The Iliad of Homer" from a website and searches the text to match individual words with words that reverse the first word's characters.
using System.Net;
using System.Text.RegularExpressions;
using System.Threading.Tasks.Dataflow;
var nonLetterRegex = new Regex(@"\P{L}", RegexOptions.Compiled);
var client = new HttpClient(new HttpClientHandler { AutomaticDecompression = DecompressionMethods.GZip });
// Setup blocks
// Downloads the requested resource as a string.
TransformBlock<string, string> downloadString = new TransformBlock<string, string>(async uri =>
{
Console.WriteLine("Downloading '{0}'...", uri);
return await client.GetStringAsync(uri);
});
// Separates the specified text into an array of words.
TransformBlock<string, string[]> createWordList = new TransformBlock<string, string[]>(text =>
{
Console.WriteLine("Creating word list...");
// Remove common punctuation by replacing all non-letter characters with a space character.
text = nonLetterRegex.Replace(text, " ");
// Separate the text into an array of words.
return text.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
});
// Removes short words.
TransformBlock<string[], string[]> filterWordList = new TransformBlock<string[], string[]>(words =>
{
Console.WriteLine("Filtering word list...");
return words
.Where(word => word.Length > 3)
.ToArray();
});
// Finds all words in the specified collection whose reverse also exists in the collection.
TransformManyBlock<string[], string> findReversedWords = new TransformManyBlock<string[], string>(words =>
{
Console.WriteLine("Finding reversed words...");
var wordsSet = new HashSet<string>(words);
return from word in wordsSet
let reverse = string.Concat(word.Reverse())
where word != reverse && wordsSet.Contains(reverse)
select word;
});
// Prints the provided reversed words to the console.
ActionBlock<string> printReversedWords = new ActionBlock<string>(reversedWord =>
{
Console.WriteLine("Found reversed words {0}/{1}", reversedWord, string.Concat(reversedWord.Reverse()));
});
// Connect the dataflow blocks to form a pipeline.
var linkOptions = new DataflowLinkOptions { PropagateCompletion = true };
downloadString.LinkTo(createWordList, linkOptions);
createWordList.LinkTo(filterWordList, linkOptions);
filterWordList.LinkTo(findReversedWords, linkOptions);
findReversedWords.LinkTo(printReversedWords, linkOptions);
// Post data to the pipeline, "The Iliad of Homer" by Homer.
downloadString.Post("http://www.gutenberg.org/cache/epub/16452/pg16452.txt");
// Mark the head of the pipeline as complete.
downloadString.Complete();
// Wait for the last block in the pipeline to process all messages.
printReversedWords.Completion.Wait();
// Output:
// Downloading 'http://www.gutenberg.org/cache/epub/16452/pg16452.txt'...
// Creating word list...
// Filtering word list...
// Finding reversed words...
// Found reversed words parts/strap
// Found reversed words deer/reed
// Found reversed words deem/meed
// Found reversed words flow/wolf
// ...
More details can be found on Dataflow (Task Parallel Library) and Walkthrough: Creating a Dataflow Pipeline pages.
The main types provided by this library are:
System.Threading.Tasks.Dataflow.ISourceBlock<TOutput>System.Threading.Tasks.Dataflow.ITargetBlock<TInput>System.Threading.Tasks.Dataflow.IPropagatorBlock<TInput,TOutput>System.Threading.Tasks.Dataflow.ActionBlock<TInput>System.Threading.Tasks.Dataflow.BatchBlock<T>System.Threading.Tasks.Dataflow.BatchedJoinBlock<T1, T2>System.Threading.Tasks.Dataflow.BroadcastBlock<T>System.Threading.Tasks.Dataflow.BufferBlock<T>System.Threading.Tasks.Dataflow.JoinBlock<T1, T2>System.Threading.Tasks.Dataflow.TransformBlock<TInput, TOutput>System.Threading.Tasks.Dataflow.TransformManyBlock<TInput, TOutput>System.Threading.Tasks.Dataflow.WriteOnceBlock<T>System.Threading.Tasks.Dataflow is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 is compatible. |
| .NET Framework | net461 net461 was computed. net462 net462 is compatible. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on System.Threading.Tasks.Dataflow:
| Package | Downloads |
|---|---|
|
Microsoft.Azure.WebJobs
This package contains the runtime host components of the WebJobs SDK. For more information, please visit https://go.microsoft.com/fwlink/?linkid=2279708. |
|
|
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects. |
|
|
Microsoft.Build.Tasks.Core
This package contains the Microsoft.Build.Tasks assembly which implements the commonly used tasks of MSBuild. |
|
|
Microsoft.Build.Runtime
This package delivers a complete executable copy of MSBuild. Reference this package only if your application needs to load projects or execute in-process builds without requiring installation of MSBuild. Successfully evaluating projects using this package requires aggregating additional components (like the compilers) into an application directory. |
|
|
Elastic.Apm
Elastic APM .NET Agent base package. This package provides core functionality for transmitting of all Elastic APM types and is a dependent package for all other Elastic APM package. Additionally this package contains the public Agent API that allows you to manually capture transactions and spans. Please install the platform specific package for the best experience. See: https://github.com/elastic/apm-agent-dotnet/tree/main/docs |
Showing the top 20 popular GitHub repositories that depend on System.Threading.Tasks.Dataflow:
| Repository | Stars |
|---|---|
|
dotnet/roslyn
The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
|
|
|
stride3d/stride
Stride (formerly Xenko), a free and open-source cross-platform C# game engine.
|
|
|
dotnet/msbuild
The Microsoft Build Engine (MSBuild) is the build platform for .NET and Visual Studio.
|
|
|
cyanfish/naps2
Scan documents to PDF and more, as simply as possible.
|
|
|
dotnetcore/DotnetSpider
DotnetSpider, a .NET standard web crawling library. It is lightweight, efficient and fast high-level web crawling & scraping framework
|
|
|
aspnet/JavaScriptServices
[Archived] This repository has been archived
|
|
|
neuecc/ZeroFormatter
Infinitely Fast Deserializer for .NET, .NET Core and Unity.
|
|
|
microsoft/GraphEngine
Microsoft Graph Engine
|
|
|
JasperFx/wolverine
Supercharged .NET server side development!
|
|
|
OmniSharp/omnisharp-roslyn
OmniSharp server (HTTP, STDIO) based on Roslyn workspaces
|
|
|
microsoft/azure-pipelines-agent
Azure Pipelines Agent 🚀
|
|
|
KirillOsenkov/MSBuildStructuredLog
A logger for MSBuild that records a structured representation of executed targets, tasks, property and item values.
|
|
|
Azure/iotedge
The IoT Edge OSS project
|
|
|
microsoft/ai-dev-gallery
An open-source project for Windows developers to learn how to add AI with local models and APIs to Windows apps.
|
|
|
tmoonlight/NSmartProxy
NSmartProxy是一款开源的内网穿透工具。采用.NET CORE的全异步模式打造。(NSmartProxy is an open source reverse proxy tool that creates a secure tunnel from a public endpoint to a locally service.)
|
|
|
copyliu/bililive_dm
B站弹幕姬 - B站直播彈幕工具
|
|
|
AElfProject/AElf
An AI-enhanced cloud-native layer-1 blockchain network.
|
|
|
atemerev/skynet
Skynet 1M threads microbenchmark
|
|
|
LionelJouin/PiP-Tool
PiP tool is a software to use the Picture in Picture mode on Windows. This feature allows you to watch content (video for example) in thumbnail format on the screen while continuing to use any other software on Windows.
|
|
|
Mimetis/Dotmim.Sync
A brand new database synchronization framework, multi platform, multi databases, developed on top of .Net Standard 2.0. https://dotmimsync.readthedocs.io/
|
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.0-preview.5.26302.115 | 129 | 6/9/2026 |
| 11.0.0-preview.4.26230.115 | 241 | 5/12/2026 |
| 11.0.0-preview.3.26207.106 | 268 | 4/14/2026 |
| 11.0.0-preview.2.26159.112 | 572 | 3/10/2026 |
| 11.0.0-preview.1.26104.118 | 369 | 2/10/2026 |
| 10.0.9 | 17,960 | 6/9/2026 |
| 10.0.8 | 77,852 | 5/12/2026 |
| 10.0.7 | 96,822 | 4/21/2026 |
| 10.0.6 | 22,508 | 4/14/2026 |
| 10.0.5 | 107,479 | 3/12/2026 |
| 10.0.4 | 27,535 | 3/10/2026 |
| 10.0.3 | 202,828 | 2/10/2026 |
| 10.0.2 | 431,967 | 1/13/2026 |
| 10.0.1 | 311,409 | 12/9/2025 |
| 9.0.17 | 402 | 6/9/2026 |
| 9.0.16 | 4,048 | 5/12/2026 |
| 9.0.15 | 10,667 | 4/14/2026 |
| 9.0.14 | 20,871 | 3/10/2026 |
| 9.0.13 | 24,724 | 2/10/2026 |
| 9.0.12 | 38,510 | 1/13/2026 |