Table of Contents

Class SemaphoreExecutor<TKey>

Namespace
Tharga.Toolkit
Assembly
Tharga.Toolkit.Standard.dll

Allows execution of one thread at a time, for a specific key. Threads with different keys will be executed in parallel. Thread with the same key will be executed one at a time.

public class SemaphoreExecutor<TKey>

Type Parameters

TKey
Inheritance
SemaphoreExecutor<TKey>
Inherited Members
Extension Methods

Methods

ExecuteAsync<T>(TKey, Func<Task<T>>)

public Task<T> ExecuteAsync<T>(TKey key, Func<Task<T>> action)

Parameters

key TKey
action Func<Task<T>>

Returns

Task<T>

Type Parameters

T