Sphyrnidae Common Library  2.0.1
Shared Utilities/Library
Sphyrnidae.Common.Utilities.NamedLocker Class Reference

Performs a lock that is "name" specific More...

Static Public Member Functions

static void Lock (string name, Action< long > method)
 Locks the method based on unique name More...
 
static async Task LockAsync (string name, Func< Task > method)
 Locks the method based on unique name More...
 
static T Lock< T > (string name, Func< long, T > method)
 Locks the method based on unique name More...
 
static async Task< T > LockAsync< T > (string name, Func< Task< T >> method)
 Locks the method based on unique name More...
 

Detailed Description

Performs a lock that is "name" specific

Member Function Documentation

◆ Lock()

static void Sphyrnidae.Common.Utilities.NamedLocker.Lock ( string  name,
Action< long >  method 
)
static

Locks the method based on unique name

Parameters
nameUnique name which acts as a lock
methodThe locked method that is locked by name

◆ Lock< T >()

static T Sphyrnidae.Common.Utilities.NamedLocker.Lock< T > ( string  name,
Func< long, T >  method 
)
static

Locks the method based on unique name

Template Parameters
TThe return type of the method
Parameters
nameUnique name which acts as a lock
methodThe locked method that is locked by name
Returns
Whatever the method returns

◆ LockAsync()

static async Task Sphyrnidae.Common.Utilities.NamedLocker.LockAsync ( string  name,
Func< Task >  method 
)
static

Locks the method based on unique name

Parameters
nameUnique name which acts as a lock
methodThe locked method that is locked by name

◆ LockAsync< T >()

static async Task<T> Sphyrnidae.Common.Utilities.NamedLocker.LockAsync< T > ( string  name,
Func< Task< T >>  method 
)
static

Locks the method based on unique name

Template Parameters
TThe return type of the method
Parameters
nameUnique name which acts as a lock
methodThe locked method that is locked by name
Returns
Whatever the method returns

The documentation for this class was generated from the following file: