C# Class Kudu.Core.Infrastructure.LockFile

Inheritance: IOperationLock
Afficher le fichier Open project: projectkudu/kudu Class Usage Examples

Méthodes publiques

Méthode Description
InitializeAsyncLocks ( ) : void
Lock ( string operationName ) : bool
LockAsync ( string operationName ) : System.Threading.Tasks.Task

Returns a lock right away or waits asynchronously until a lock is available.

LockFile ( string path ) : System
LockFile ( string path, ITraceFactory traceFactory ) : System
Release ( ) : void
TerminateAsyncLocks ( ) : void

Because of a bug in Ninject in how it disposes objects in the global scope for each request we can't use Dispose to shut down the file system watcher. Otherwise this would get disposed on every request.

Méthodes protégées

Méthode Description
OnLockAcquired ( ) : void
OnLockRelease ( ) : void

Private Methods

Méthode Description
DeleteFileSafe ( ) : void
OnLockReleasedInternal ( object sender, FileSystemEventArgs e ) : void

When a lock file change has been detected we check whether there are queued up lock requests. If so then we attempt to get the lock and dequeue the next request.

ReadLockInfo ( ) : OperationLockInfo
TraceIfUnknown ( Exception ex ) : void
WriteLockInfo ( string operationName, Stream lockStream ) : void

Method Details

InitializeAsyncLocks() public méthode

public InitializeAsyncLocks ( ) : void
Résultat void

Lock() public méthode

public Lock ( string operationName ) : bool
operationName string
Résultat bool

LockAsync() public méthode

Returns a lock right away or waits asynchronously until a lock is available.
public LockAsync ( string operationName ) : System.Threading.Tasks.Task
operationName string
Résultat System.Threading.Tasks.Task

LockFile() public méthode

public LockFile ( string path ) : System
path string
Résultat System

LockFile() public méthode

public LockFile ( string path, ITraceFactory traceFactory ) : System
path string
traceFactory ITraceFactory
Résultat System

OnLockAcquired() protected méthode

protected OnLockAcquired ( ) : void
Résultat void

OnLockRelease() protected méthode

protected OnLockRelease ( ) : void
Résultat void

Release() public méthode

public Release ( ) : void
Résultat void

TerminateAsyncLocks() public méthode

Because of a bug in Ninject in how it disposes objects in the global scope for each request we can't use Dispose to shut down the file system watcher. Otherwise this would get disposed on every request.
public TerminateAsyncLocks ( ) : void
Résultat void