Skip to content

@codesoul-co/hypha-core / modules/runtime/runtime-capacity-semaphore

Using this module

Use the Runtime capacity semaphore module for executing runtime behavior at this boundary. It exports 1 class, 1 interface.

Import from the package entrypoint

ts
import {
  InMemoryRuntimeCapacitySemaphore,
} from '@codesoul-co/hypha-core';

import type {
  InMemoryRuntimeCapacitySemaphoreOptions,
} from '@codesoul-co/hypha-core';

Usage patterns

  • Use the 1 type/interface export as static contracts in application code, adapters, or tests. Import them with import type; they do not exist at runtime.
  • The module exposes 1 class as constructable runtime implementations. Each symbol entry lists its constructor and public methods.

Public exports

SymbolKindSignatureDescription
InMemoryRuntimeCapacitySemaphoreclassnew InMemoryRuntimeCapacitySemaphore(options: InMemoryRuntimeCapacitySemaphoreOptions): InMemoryRuntimeCapacitySemaphoreIn Memory Runtime Capacity Semaphore class with 6 public constructor or member entries; its exact declarations are listed below.
InMemoryRuntimeCapacitySemaphoreOptionsinterfaceinterface InMemoryRuntimeCapacitySemaphoreOptionsIn Memory Runtime Capacity Semaphore Options interface with 1 public fields or methods.

InMemoryRuntimeCapacitySemaphore

In Memory Runtime Capacity Semaphore class with 6 public constructor or member entries; its exact declarations are listed below.

Declaration

text
export declare class InMemoryRuntimeCapacitySemaphore implements RuntimeCapacitySemaphore {
    constructor(options: InMemoryRuntimeCapacitySemaphoreOptions);
    acquire(request: RuntimeCapacityAcquireRequest): Promise<RuntimeCapacityLease | null>;
    renew(request: RuntimeCapacityRenewRequest): Promise<RuntimeCapacityLease>;
    release(request: RuntimeCapacityReleaseRequest): Promise<void>;
    assertCurrent(request: RuntimeCapacityAssertionRequest): Promise<RuntimeCapacityLease>;
    usage(request: RuntimeCapacityUsageRequest): Promise<RuntimeCapacityUsage>;
}

Public members

MemberKindSignatureDescription
acquiremethodacquire(request: RuntimeCapacityAcquireRequest): Promise<RuntimeCapacityLease | null>Public method; parameters and return type are shown in the signature.
assertCurrentmethodassertCurrent(request: RuntimeCapacityAssertionRequest): Promise<RuntimeCapacityLease>Public method; parameters and return type are shown in the signature.
constructorconstructor(options: InMemoryRuntimeCapacitySemaphoreOptions): InMemoryRuntimeCapacitySemaphoreCreates an instance of this class.
releasemethodrelease(request: RuntimeCapacityReleaseRequest): Promise<void>Public method; parameters and return type are shown in the signature.
renewmethodrenew(request: RuntimeCapacityRenewRequest): Promise<RuntimeCapacityLease>Public method; parameters and return type are shown in the signature.
usagemethodusage(request: RuntimeCapacityUsageRequest): Promise<RuntimeCapacityUsage>Public method; parameters and return type are shown in the signature.

InMemoryRuntimeCapacitySemaphoreOptions

In Memory Runtime Capacity Semaphore Options interface with 1 public fields or methods.

Declaration

text
export interface InMemoryRuntimeCapacitySemaphoreOptions {
    policy: RuntimeCapacityPolicy;
}

Contract members

MemberKindSignatureDescription
policypropertypolicy: RuntimeCapacityPolicyPublic property; its type, readonly modifier and optionality are shown in the signature.