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

The last sent message, if any.

This is sometimes convenient to access during benchmarks.

Methods

  • getTotalSentBytes(): number
  • Returns the total number of bytes in messages sent by all runtimes.

    Returns number

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

    Parameters

    • Optional 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
  • Release all queued messages.

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

    Returns void

Generated using TypeDoc