BufferQ 1.0.2
See the version list below for details.
dotnet add package BufferQ --version 1.0.2
NuGet\Install-Package BufferQ -Version 1.0.2
<PackageReference Include="BufferQ" Version="1.0.2" />
paket add BufferQ --version 1.0.2
#r "nuget: BufferQ, 1.0.2"
// Install BufferQ as a Cake Addin #addin nuget:?package=BufferQ&version=1.0.2 // Install BufferQ as a Cake Tool #tool nuget:?package=BufferQ&version=1.0.2
BufferQ
What is BufferQ ?
BufferQ is a solution for managing batch records between source and target with buffering. BufferQ designed to store data in on a thread safe queue as a buffer and multiple thread workers to consume that queue.
Benefits
It is ideal for doing multi thread work with thread safe structure. Common usage for,
- Process multiple database items
- Preloading requests to get ready for busy times
- High density buffer usage
Solves
- Backlogged items in a bottleneck
- Deadlocks when common accessed data
- Time waste of sequence process
Sample Use Case
Sms Provider
You are a SMS Provider and need to send multiple SMS in a short time. But your sms items stored in database table, need to read these data and process on code base. Most used scenerios one by one data read from db and process to send sms. But using BufferQ provides you to read only one time and batch data. All these data stored in a thread safe queue in memory. Specified amount of threads starts to consume that queue and process sms sending. So millions of records will be melt in a short time.
Coupon Generator
You are creating coupons but takes time to create each one. Multiple requests can be cause to creation of each coupon and user to be wait. So buffering can be a simple way for that. Some coupon can be generated and added to queue to get ready on user demand.
Code Sample
static void Main(string[] args)
{
BufferQ<DbRow> bufferq = new BufferQ<DbRow>();
bufferq.OnQueueEmpty += Bufferq_OnQueueEmpty;
int threadCount = 5;
bufferq.Start(threadCount, DoYourWork);
}
private static void DoYourWork(DbRow queueItem)
{
//This method will called from a seperated thread
//queueItem item retrieve from queue
//do what ever you want with queuItem
}
private static void Bufferq_OnQueueEmpty(object sender, BufferQEventArgs<DbRow> e)
{
//Fill queue here
//Get your records from source (db, api etc.)
//Add in to queue
//e.Queue.Enqueue(dbRow);
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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. |
.NET Core | netcoreapp1.0 is compatible. netcoreapp1.1 was computed. netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
-
.NETCoreApp 1.0
- Microsoft.NETCore.App (>= 1.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.