ConcurrentFileWriter 1.0.2

.NET Framework 4.0
dotnet add package ConcurrentFileWriter --version 1.0.2
NuGet\Install-Package ConcurrentFileWriter -Version 1.0.2
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="ConcurrentFileWriter" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ConcurrentFileWriter --version 1.0.2
#r "nuget: ConcurrentFileWriter, 1.0.2"
#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 ConcurrentFileWriter as a Cake Addin
#addin nuget:?package=ConcurrentFileWriter&version=1.0.2

// Install ConcurrentFileWriter as a Cake Tool
#tool nuget:?package=ConcurrentFileWriter&version=1.0.2

A class library for managing multi-threaded sequential write access to one or more files.
It is capable of flushing writes from multiple threads in batches by either hitting a specified size threshold or a specified inactivity time limit. It is also possible to write this batching information within the output file(s).
Note: This class should be injected as a single or static instance shared across all process threads.
Files will be locked exclusively from the first Write() call until FlushAndClose() or Dispose() is called (presently one of these *must* be explicitly called to ensure all data is flushed).

The ConcurrentFileWriter class can be found as an extension of System.IO

*** Full debugging source/symbols are available from

Usage Example:

var cfw = new ConcurrentFileWriter(new ConcurrentFileWriterSettings {
            flushTimeInMilliseconds = 5000,
            flushSizeInBytes = 10000,
            showWriteBatchingMarkers = true

//Pre-lock file (not required)
cfw.Write(@"c:\temp\test.log", null);

//Append a string (byte arrays can also be directly written)
cfw.WriteUtf8Line(@"c:\temp\test.log", "Test Line");

//Flush and unlock specified file (stop managing)

//Flush and unlock all managed files

Product Compatible and additional computed target framework versions.
.NET Framework net40 is compatible.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

This package has 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.

Version Downloads Last updated
1.0.2 2,202 11/30/2015
1.0.1 1,467 11/30/2015
1.0.0 4,764 11/28/2015

*** Still requires an explicit call to FlushAndClose() for a specific managed file or Dispose() on the ConcurrentFileWriter instance at the end of use.