Options
All
  • Public
  • Public/Protected
  • All
Menu

Replicated Entity.

Type Parameters

Hierarchy

  • ReplicatedEntity

Implements

Index

Properties

serviceName: string

The gRPC service name for this component.

service: Service

The protobuf Service for this component.

Options for this component.

Access to gRPC clients (with promisified unary methods).

The command handlers.

remarks

The names of the properties must match the names of the service calls specified in the gRPC descriptor for this Replicated Entity service.

onStateSet: OnStateSetCallback<State>

A callback that is invoked whenever the Replicated Data state is set for this Replicated Entity.

remarks

This is invoked whenever a new Replicated Data state is set on the Replicated Entity, to allow the state to be enriched with domain specific properties and methods. This may be due to the state being set explicitly from a command handler on the command context, or implicitly as the default value, or implicitly when a new state is received from the proxy.

A callback that is invoked to create a default value if the Kalix proxy doesn't send an existing one.

Constructors

  • Create a Replicated Entity.

    Type Parameters

    Parameters

    • desc: string | string[]

      The file name of a protobuf descriptor or set of descriptors containing the Replicated Entity service

    • serviceName: string

      The fully qualified name of the gRPC service that this Replicated Entity implements

    • entityType: string

      The entity type name, used to namespace entities of different Replicated Data types in the same service

    • Optional options: replicatedentity.ReplicatedEntity.Options

      The options for this entity

    Returns ReplicatedEntity<State>

Methods

  • lookupType(messageType: string): Type
  • Lookup a protobuf message type.

    This is provided as a convenience to lookup protobuf message types.

    Parameters

    • messageType: string

    Returns Type

    The protobuf message type

Generated using TypeDoc