Module

services/physics-gateway

Physics Gateway Service

Serialization (one command at a time) is at RabbitMQ level: Chrono must consume from physics_engine_commands with prefetch(1) or a single worker. Then "waiting" = messages in the queue; "running" = the one unacked message Chrono is processing. No Node-side queue needed.

View Source services/physics-gateway.service.js, line 1

Classes

PhysicsGatewayService

Members

# inner constant RECEIVE_TIMEOUT_MS

Receive timeout in ms

View Source services/physics-gateway.service.js, line 34

# inner constant STATE_TOPIC_PREFIX

Topic prefix for state broadcasts (routing key: state.{connection_id}.{investigation_id})

View Source services/physics-gateway.service.js, line 32

Methods

# inner findInvalidBatchCommandEntry(payload) → {Object|null}

Find invalid entries (null/undefined) inside batch commands payload

Parameters:
Name Type Description
payload object

Physics command payload

View Source services/physics-gateway.service.js, line 40

Invalid entry details

Object | null

# inner isSystemError(error) → {boolean}

Type guard to check if error has system properties

Parameters:
Name Type Description
error unknown

The error to check

View Source services/physics-gateway.service.js, line 20

True if error has system properties

boolean

# inner sanitizeBatchPayload(payload) → {object}

Sanitize batch payload (remove null/undefined entries)

Parameters:
Name Type Description
payload object

Physics command payload

View Source services/physics-gateway.service.js, line 61

Sanitization metadata (removedIndices/originalCount/sanitizedCount)

object