C# Class FiftyOne.Foundation.Mobile.Detection.Entities.Stream.Pool

As multiple threads need to read from the SourceBase concurrently this class provides a mechanisim for readers to be recycled across threads and requests.
The DataSet must be disposed of to ensure the readers in the pool are closed.
Inheritance: IDisposable
Show file Open project: 51Degrees/dotNET-Device-Detection Class Usage Examples

Private Properties

Property Type Description

Public Methods

Method Description
GetReader ( ) : Reader

Returns a reader to the temp file for exclusive use. Release method must be called to return the reader to the pool when finished.

Pool ( SourceBase source ) : System

Constructs a new pool of readers for SourceBase provided.

Release ( Reader reader ) : void

Returns the reader to the pool to be used by another process later.

Method Details

GetReader() public method

Returns a reader to the temp file for exclusive use. Release method must be called to return the reader to the pool when finished.
public GetReader ( ) : Reader
return FiftyOne.Foundation.Mobile.Detection.Readers.Reader

Pool() public method

Constructs a new pool of readers for SourceBase provided.
public Pool ( SourceBase source ) : System
source SourceBase /// The data source for the list. ///
return System

Release() public method

Returns the reader to the pool to be used by another process later.
public Release ( Reader reader ) : void
reader FiftyOne.Foundation.Mobile.Detection.Readers.Reader /// Reader open and ready to read from the temp file. ///
return void