Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TestingRuntimes

Creates a collection of CRuntimes linked together (in-memory networking) that delivers messages when release is called.

This is useful for tests, including tests with concurrent operations.

Hierarchy

  • TestingRuntimes

Index

Constructors

Properties

lastMessage?: Uint8Array = undefined

The last sent message, if any.

This is sometimes convenient to access during benchmarks.

Methods

  • getTotalSentBytes(): number
  • newRuntime(options?: { causalityGuaranteed?: boolean; rng?: prng; skipRedundantLoads?: boolean }): CRuntime
  • Returns a new CRuntime linked with all prior runtimes created by this TestingRuntime.

    Parameters

    • options: { causalityGuaranteed?: boolean; rng?: prng; skipRedundantLoads?: boolean } = {}
      • Optional causalityGuaranteed?: boolean
      • Optional rng?: prng

        A PRNG used to deterministically set the replicaID (via [[ReplicaIDs.pseudoRandom]]).

      • Optional skipRedundantLoads?: boolean

        Opposite of DocOptions.allowRedundantLoads. This defaults to false, so that redundant loads are allowed by default, opposite to CRuntime's default; that way you can test your load functions' idempotence.

    Returns CRuntime

  • Releases all queued messages from sender to the specified recipients. If recipients are not specified, releases them to all recipients.

    Only recipients that existed at the time of sending will receive a message.

    Parameters

    Returns void

  • releaseAll(): void

Generated using TypeDoc