Skip to main content Link Search Menu Expand Document (external link)

TSemaphore overview

Added in v2.0.0


Table of contents


constructors

make

Signature

export declare const make: (permits: number) => STM.STM<TSemaphore>

Added in v2.0.0

getters

available

Signature

export declare const available: (self: TSemaphore) => STM.STM<number>

Added in v2.0.0

models

TSemaphore (interface)

Signature

export interface TSemaphore extends TSemaphore.Proto {}

Added in v2.0.0

mutations

acquire

Signature

export declare const acquire: (self: TSemaphore) => STM.STM<void>

Added in v2.0.0

acquireN

Signature

export declare const acquireN: {
  (n: number): (self: TSemaphore) => STM.STM<void>
  (self: TSemaphore, n: number): STM.STM<void>
}

Added in v2.0.0

release

Signature

export declare const release: (self: TSemaphore) => STM.STM<void>

Added in v2.0.0

releaseN

Signature

export declare const releaseN: {
  (n: number): (self: TSemaphore) => STM.STM<void>
  (self: TSemaphore, n: number): STM.STM<void>
}

Added in v2.0.0

withPermit

Signature

export declare const withPermit: {
  (semaphore: TSemaphore): <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>
  <A, E, R>(self: Effect.Effect<A, E, R>, semaphore: TSemaphore): Effect.Effect<A, E, R>
}

Added in v2.0.0

withPermitScoped

Signature

export declare const withPermitScoped: (self: TSemaphore) => Effect.Effect<void, never, Scope.Scope>

Added in v2.0.0

withPermits

Signature

export declare const withPermits: {
  (semaphore: TSemaphore, permits: number): <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>
  <A, E, R>(self: Effect.Effect<A, E, R>, semaphore: TSemaphore, permits: number): Effect.Effect<A, E, R>
}

Added in v2.0.0

withPermitsScoped

Signature

export declare const withPermitsScoped: {
  (permits: number): (self: TSemaphore) => Effect.Effect<void, never, Scope.Scope>
  (self: TSemaphore, permits: number): Effect.Effect<void, never, Scope.Scope>
}

Added in v2.0.0

symbols

TSemaphoreTypeId

Signature

export declare const TSemaphoreTypeId: typeof TSemaphoreTypeId

Added in v2.0.0

TSemaphoreTypeId (type alias)

Signature

export type TSemaphoreTypeId = typeof TSemaphoreTypeId

Added in v2.0.0

unsafe

unsafeMake

Signature

export declare const unsafeMake: (permits: number) => TSemaphore

Added in v2.0.0

utils

TSemaphore (namespace)

Added in v2.0.0

Proto (interface)

Signature

export interface Proto {
  readonly [TSemaphoreTypeId]: TSemaphoreTypeId
}

Added in v2.0.0