Skip to content

ShardingRegistrationEvent.ts

The ShardingRegistrationEvent module models the live notifications emitted by Sharding when the local runner registers an entity handler or singleton. Consumers can use these events to wait for registrations during startup, inspect which capabilities a runner made available, or assert registration behavior in tests.

Since v4.0.0



Represents an event that occurs when a new entity is registered with a runner.

Signature

export interface EntityRegistered {
readonly _tag: "EntityRegistered"
readonly entity: Entity<any, any>
}

Source

Since v4.0.0

Represents events that can occur when a runner registers entities or singletons.

Signature

type ShardingRegistrationEvent = EntityRegistered | SingletonRegistered

Source

Since v4.0.0

Represents an event that occurs when a new singleton is registered with a runner.

Signature

export interface SingletonRegistered {
readonly _tag: "SingletonRegistered"
readonly address: SingletonAddress
}

Source

Since v4.0.0

{

/**

  • Pattern matches on a sharding registration event and dispatches to the
  • matching variant handler.
  • @category pattern matching
  • @since 4.0.0 */ $match: match, /**
  • Creates an event for an entity registered by the local runner.
  • @category constructors
  • @since 4.0.0 */ EntityRegistered, /**
  • Creates an event for a singleton registered by the local runner.
  • @category constructors
  • @since 4.0.0 */ SingletonRegistered }

Constructors and matchers for sharding registration events.

Signature

declare const {
/**
* Pattern matches on a sharding registration event and dispatches to the
* matching variant handler.
*
* @category pattern matching
* @since 4.0.0
*/
$match: match,
/**
* Creates an event for an entity registered by the local runner.
*
* @category constructors
* @since 4.0.0
*/
EntityRegistered,
/**
* Creates an event for a singleton registered by the local runner.
*
* @category constructors
* @since 4.0.0
*/
SingletonRegistered
}: any

Source

Since v4.0.0