Show / Hide Table of Contents

Interface IResourceCounter

Interface for generic common resource counter, which allows instant freeing, and asynchronous taking.

Namespace: Cognite.Extractor.Common
Assembly: Cognite.Common.dll
Syntax
public interface IResourceCounter

Methods

| Edit this page View Source

Free(int)

Releases count resources. Behavior is not defined if this number was not taken before.

Declaration
void Free(int count)
Parameters
Type Name Description
int count

Number of resources to free.

| Edit this page View Source

Take(int, bool)

Take up to count instances of the resource. If shouldBlock is true, returns at least 1 and blocks until this is possible.

Declaration
Task<int> Take(int count, bool shouldBlock)
Parameters
Type Name Description
int count

Maximum number to take

bool shouldBlock

True if this request should block if no resources are available

Returns
Type Description
Task<int>

The number of resources granted. If shouldBlock is true then at least 1, always no more than count

Extension Methods

DataModelUtils.GetOrCreateResourcesAsync<T, T2>(T2, IEnumerable<InstanceIdentifier>, Func<IEnumerable<InstanceIdentifier>, IEnumerable<SourcedNodeWrite<T>>>, Func<IEnumerable<SourcedNodeWrite<T>>, SanitationMode, (IEnumerable<SourcedNodeWrite<T>>, IEnumerable<CogniteError<SourcedNodeWrite<T>>>)>, int, int, RetryMode, SanitationMode, CancellationToken)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX