Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Transaction<Arguments, Result, Status> Abstract

Type Parameters

  • Arguments extends unknown[]

  • Result = unknown

  • Status = unknown

Hierarchy

Index

Constructors

  • new Transaction<Arguments, Result, Status>(): Transaction<Arguments, Result, Status>
  • Type Parameters

    • Arguments extends unknown[]

    • Result = unknown

    • Status = unknown

    Returns Transaction<Arguments, Result, Status>

Properties

_open: boolean = true
_result: Deferred<false | Result> = ...
inUse: boolean = false

Whether any actions have been added to the transaction. The Transaction will not self-dispose until at least one action has been performed.

onWillConcludeEmitter: Emitter<OnWillConcludeEvent<Status>> = ...
queue: Mutex = ...

The transaction will self-dispose when the queue is empty, once at least one action has been processed.

status: Deferred<Status> = ...

Accessors

  • get open(): boolean
  • get result(): Promise<false | Result>

Methods

  • act(...args: Arguments): MaybePromise<Result>
  • conclude(): Promise<void>
  • dispose(): void
  • disposeWhenDone(): void
  • doInit(): Promise<void>
  • enqueueAction(...args: Arguments): Promise<false | Result>
  • init(): void
  • setUp(): MaybePromise<Status>
  • tearDown(): MaybePromise<Result>
  • waitFor(delay?: Promise<unknown>, disposeIfRejected?: boolean): Promise<void>