C# Class Lucene.Net.Store.RateLimiter.SimpleRateLimiter

Simple class to rate limit IO.
Inheritance: RateLimiter
显示文件 Open project: paulirwin/lucene.net Class Usage Examples

Public Methods

Method Description
Pause ( long bytes ) : long

Pauses, if necessary, to keep the instantaneous IO rate at or below the target. NOTE: multiple threads may safely use this, however the implementation is not perfectly thread safe but likely in practice this is harmless (just means in some rare cases the rate might exceed the target). It's best to call this with a biggish count, not one byte at a time.

SimpleRateLimiter ( double mbPerSec ) : System.Threading

mbPerSec is the MB/sec max IO rate

Method Details

Pause() public method

Pauses, if necessary, to keep the instantaneous IO rate at or below the target. NOTE: multiple threads may safely use this, however the implementation is not perfectly thread safe but likely in practice this is harmless (just means in some rare cases the rate might exceed the target). It's best to call this with a biggish count, not one byte at a time.
public Pause ( long bytes ) : long
bytes long
return long

SimpleRateLimiter() public method

mbPerSec is the MB/sec max IO rate
public SimpleRateLimiter ( double mbPerSec ) : System.Threading
mbPerSec double
return System.Threading