Skip to main content Link Search Menu Expand Document (external link)

RecipientType overview

Added in v1.0.0


Table of contents


constructors

isRecipientType

Ensure that given value is a RecipientType

Signature

export declare function isRecipientType<A extends Message.Message.Any>(value: unknown): value is RecipientType<A>

Added in v1.0.0

makeEntityType

Given a name and a schema for the protocol, constructs an EntityType.

Signature

export declare function makeEntityType<Msg extends Message.Message.Any, I>(
  name: string,
  schema: Schema.Schema<Msg, I>
): EntityType<Msg>

Added in v1.0.0

makeTopicType

Given a name and a schema for the protocol, constructs an TopicType.

Signature

export declare function makeTopicType<Msg extends Message.Message.Any, I>(
  name: string,
  schema: Schema.Schema<Msg, I>
): TopicType<Msg>

Added in v1.0.0

models

EntityType (class)

An EntityType is a RecipientType that is ensured to be alive only on a single Pod at a time.

Signature

export declare class EntityType<Msg>

Added in v1.0.0

[Hash.symbol] (method)

Signature

[Hash.symbol](): number

Added in v1.0.0

[Equal.symbol] (method)

Signature

[Equal.symbol](this: TopicType<Msg>, that: Equal.Equal): boolean

Added in v1.0.0

[RecipientTypeTypeId] (property)

Signature

readonly [RecipientTypeTypeId]: symbol

Added in v1.0.0

RecipientType (type alias)

A RecipientType is basically a pointer to a logical grouping of multiple enties having the same RecipientBehaviour. This value is required to be able to message with an entity/topic since it holds the Schema for the messages over the wire. Without the schema, you cannot ensure that the messages sent are what the receiver expects. Ideally, you can share this definition between the caller and the receiver.

Signature

export type RecipientType<Msg extends Message.Message.Any> = EntityType<Msg> | TopicType<Msg>

Added in v1.0.0

TopicType (class)

A TopicType can live on multiple Pods at the same time.

Signature

export declare class TopicType<Msg>

Added in v1.0.0

[Hash.symbol] (method)

Signature

[Hash.symbol](): number

Added in v1.0.0

[Equal.symbol] (method)

Signature

[Equal.symbol](this: EntityType<Msg>, that: Equal.Equal): boolean

Added in v1.0.0

[RecipientTypeTypeId] (property)

Signature

readonly [RecipientTypeTypeId]: symbol

Added in v1.0.0

symbols

RecipientTypeTypeId

Signature

export declare const RecipientTypeTypeId: typeof RecipientTypeTypeId

Added in v1.0.0