NamedCacheAsyncExtensionsReleaseLockAsync Method (NamedCache, String, LockTicket, CancellationToken)

ScaleOut Software NamedCache API
Asynchronously releases the lock on a cached object. This extension method is simply a convenience wrapper for ReleaseLockAsync(CachedObjectId, LockTicket, CancellationToken) that creates a CachedObjectId from id.

Namespace:  Soss.Client.Extensions
Assembly:  soss_namedcache (in soss_namedcache.dll) Version: 6.1.0.0
Syntax

public static Task ReleaseLockAsync(
	this NamedCache cache,
	string id,
	LockTicket lockTicket,
	CancellationToken cancellationToken = null
)

Parameters

cache
Type: Soss.ClientNamedCache
the NamedCache this extension method operates on.
id
Type: SystemString
a String that will be transformed into a CachedObjectId via CreateKey(String) which identifies the object in the cache.
lockTicket
Type: Soss.ClientLockTicket
a LockTicket returned by AcquireLockAsync(CachedObjectId, LockTicket, CancellationToken), or RetrieveAsync(CachedObjectId, RetrieveOptions, LockTicket, CancellationToken), or PutAsync(CachedObjectId, Object, CreatePolicy, PutOptions, LockTicket, CancellationToken) that represents the object lock state in the cache.
cancellationToken (Optional)
Type: System.ThreadingCancellationToken
An optional CancellationToken that can be used to cancel the asynchronous operation.

Return Value

Type: Task
an awaitable Task

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type NamedCache. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions

ExceptionCondition
ArgumentNullExceptionThrown when id is null.
Remarks

Calling ReleaseLockAsync(NamedCache, String, LockTicket, CancellationToken) on an object that is not locked with the supplied lockTicket has no effect.
See Also

Reference