Table of Contents

Delegate FetchDataDelegate<TKey, TValue>

Namespace
GreenDonut
Assembly
GreenDonut.dll

A data fetching delegate for DataLoader. For every provided key must be a result returned. Also to be mentioned is, the results must be returned in the exact same order the keys were provided.

public delegate ValueTask FetchDataDelegate<in TKey, TValue>(IReadOnlyList<in TKey> keys, Memory<Result<TValue>> results, CancellationToken cancellationToken) where TKey : notnull

Parameters

keys IReadOnlyList<TKey>

A list of keys.

results Memory<Result<TValue>>

The resolved values which need to be in the exact same order as the keys were provided.

cancellationToken CancellationToken

A cancellation token.

Returns

ValueTask

A list of results which are in the exact same order as the provided keys.

Type Parameters

TKey

A key type.

TValue

A value type.

Constructors

FetchDataDelegate(object, nint)

public FetchDataDelegate(object @object, nint method)

Parameters

object object
method nint

Methods

BeginInvoke(IReadOnlyList<TKey>, Memory<Result<TValue>>, CancellationToken, AsyncCallback, object)

public virtual IAsyncResult BeginInvoke(IReadOnlyList<in TKey> keys, Memory<Result<TValue>> results, CancellationToken cancellationToken, AsyncCallback callback, object @object)

Parameters

keys IReadOnlyList<TKey>
results Memory<Result<TValue>>
cancellationToken CancellationToken
callback AsyncCallback
object object

Returns

IAsyncResult

EndInvoke(IAsyncResult)

public virtual ValueTask EndInvoke(IAsyncResult result)

Parameters

result IAsyncResult

Returns

ValueTask

Invoke(IReadOnlyList<TKey>, Memory<Result<TValue>>, CancellationToken)

public virtual ValueTask Invoke(IReadOnlyList<in TKey> keys, Memory<Result<TValue>> results, CancellationToken cancellationToken)

Parameters

keys IReadOnlyList<TKey>
results Memory<Result<TValue>>
cancellationToken CancellationToken

Returns

ValueTask