BufferQ 1.0.3

dotnet add package BufferQ --version 1.0.3                
NuGet\Install-Package BufferQ -Version 1.0.3                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BufferQ" Version="1.0.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add BufferQ --version 1.0.3                
#r "nuget: BufferQ, 1.0.3"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install BufferQ as a Cake Addin
#addin nuget:?package=BufferQ&version=1.0.3

// Install BufferQ as a Cake Tool
#tool nuget:?package=BufferQ&version=1.0.3                

BufferQ

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, DoYourWorkCallback);
        }

        private static void DoYourWorkCallback(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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.3 480 4/3/2022
1.0.2 421 4/3/2022
1.0.1 425 4/3/2022
1.0.0 412 3/30/2022