Table of Contents

Class ParallelBulkWriter<TData>

Namespace
Hi.Common.ParallelBulkUtils
Assembly
HiGeom.dll

Parallel bulk writer that efficiently processes and writes data in parallel. The writing data is buffered and processed on a separate task to improve performance.

public class ParallelBulkWriter<TData> : IDisposable where TData : class

Type Parameters

TData

The type of data to write.

Inheritance
ParallelBulkWriter<TData>
Implements
Inherited Members
Extension Methods

Constructors

ParallelBulkWriter(Action<List<TData>>, int)

Initializes a new instance of the ParallelBulkWriter<TData> class.

public ParallelBulkWriter(Action<List<TData>> addAllFunc, int writingBufferCap = 131072)

Parameters

addAllFunc Action<List<TData>>

The function used to add all data items to the destination.

writingBufferCap int

The capacity of the writing buffer. Default is 1024 * 128.

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Dispose(bool)

Releases the unmanaged resources used by the ParallelBulkWriter<TData> and optionally releases the managed resources.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

Enqueue(TData)

Adds a data item to the writing buffer for processing.

public void Enqueue(TData step)

Parameters

step TData

The data item to add.

WaitAll()

Waits for all data items in the buffer to be processed.

public void WaitAll()