TaskForgeSparks 1.0.3
dotnet add package TaskForgeSparks --version 1.0.3
NuGet\Install-Package TaskForgeSparks -Version 1.0.3
<PackageReference Include="TaskForgeSparks" Version="1.0.3" />
<PackageVersion Include="TaskForgeSparks" Version="1.0.3" />
<PackageReference Include="TaskForgeSparks" />
paket add TaskForgeSparks --version 1.0.3
#r "nuget: TaskForgeSparks, 1.0.3"
#:package TaskForgeSparks@1.0.3
#addin nuget:?package=TaskForgeSparks&version=1.0.3
#tool nuget:?package=TaskForgeSparks&version=1.0.3
TaskForgeSparks
Overview
TaskForgeSparks is a .NET library that provides utilities for concurrent processing of lists of entities. It offers methods to divide a list into subsets and execute actions in parallel on each subset using action blocks. This allows for efficient handling of asynchronous workflows, optimizing resource utilization while ensuring faster execution.
Installation
You can install TaskForgeSparks via NuGet Package Manager:
Install-Package TaskForgeSparks -Version 1.0.3
Usage
ProcessServicesInThread
This method processes a list of entities concurrently by dividing the list into subsets and executing an action in parallel on each subset using action blocks.
public static async Task ProcessServicesInThread<T>(IList<T> CollectionsEntities, Action<T> action, int byService = 50) where T : class
CollectionsEntities: The list of entities to process.action: The action to execute on each entity.byService(optional): The size of the subset of entities processed in each thread (default: 50).
ProcessServicesInThread (Async)
This method processes a list of entities concurrently using asynchronous functions, allowing for better utilization of system resources without blocking the main thread.
public static void ProcessServicesInThread<T>(IList<T> CollectionsEntities, Func<T, Task> action, int byService = 50) where T : class
CollectionsEntities: The list of entities to process.action: The asynchronous function to perform on each entity.byService(optional): The size of the subset of entities processed in each thread (default: 50).
Additional Notes
- For both methods, if excessive waiting time is observed when using asynchronous methods, it may indicate inefficiencies in the workflow.
- The library dynamically calculates thread allocations based on the total count of elements and the default count specified.
- The library utilizes the available processor count for parallel execution, optimizing performance.
Example
using TaskForgeSparks;
var entities = GetEntities(); // Get list of entities
await TaskFlowManager.ProcessServicesInThread(entities, entity => ProcessEntity(entity));
License
This library is licensed under the MIT License. See the LICENSE file for details.
Developed by TaskForgeSparks Team.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.