Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EventSourcedEntity<State, Events, CommandHandlers, EventHandlers>

Event Sourced Entity.

Type Parameters

Hierarchy

  • EventSourcedEntity

Implements

Index

Properties

serviceName: string

The gRPC service name for this component.

service: Service

The protobuf Service for this component.

options: Required<EventSourcedEntity.Options>

Options for this component.

Access to gRPC clients (with promisified unary methods).

The initial state callback.

behavior?: BehaviorCallback<State, Events, CommandHandlers, EventHandlers>

The behavior callback.

Constructors

  • new EventSourcedEntity<State, Events, CommandHandlers, EventHandlers>(desc: string | string[], serviceName: string, entityType: string, options?: EventSourcedEntity.Options): EventSourcedEntity<State, Events, CommandHandlers, EventHandlers>
  • Create a new event sourced entity.

    remarks

    Note that the entityType will be prefixed onto the entityId when storing the events for this entity. Be aware that the chosen name must be stable through the entity lifecycle. Never change it after deploying a service that stored data of this type.

    Type Parameters

    Parameters

    • desc: string | string[]

      A descriptor or list of descriptors to parse, containing the service to serve

    • serviceName: string

      The fully qualified name of the service that provides this entities interface

    • entityType: string

      The entity type name for all event source entities of this type

    • Optional options: EventSourcedEntity.Options

      The options for this event sourced entity

    Returns EventSourcedEntity<State, Events, CommandHandlers, EventHandlers>

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