Skip to main content
Version: Current

Receiver

@rotorsoft/act-root


@rotorsoft/act-root / act-ops/src/receiver / Receiver

Type Alias: Receiver

Receiver = object

Defined in: libs/act-ops/src/receiver/port.ts:44

Generic inbound-receiver port — the runtime artifact produced by ReceiverBuilder.build. Transport-agnostic: the same shape fits HTTP webhooks, message-bus consumers (Kafka/SQS/NATS/Rabbit), CDC streams, WebSocket subscribers, scheduled pollers, and any other "external events arrive into this Act app" pattern.

Adapters in @rotorsoft/act-http/receiver implement the HTTP flavor today; bus consumers and other transport adapters implement the same port in their own packages without redesigning the contract.

Two deployment modes:

  • Long-running server — listen binds to a port (HTTP), a topic (bus), a path (WebSocket), etc.
  • Request-response (Lambda / edge / serverless) — fetch handles one request and returns the response. Available on the HTTP adapter; bus consumers and other non-fetch transports throw.

Methods​

close()​

close(): Promise<void>

Defined in: libs/act-ops/src/receiver/port.ts:54

Stop gracefully. Resolves when the transport has shut down. No-op if never started.

Returns​

Promise<void>


fetch()​

fetch(request): Promise<Response>

Defined in: libs/act-ops/src/receiver/port.ts:60

Handle a single fetch-shaped request. Available on the HTTP adapter for Lambda / Cloudflare Workers / Vercel Edge / Bun / Deno. Bus consumers and other non-fetch transports throw.

Parameters​

request​

Request

Returns​

Promise<Response>


listen()​

listen(): Promise<void>

Defined in: libs/act-ops/src/receiver/port.ts:49

Bind and start accepting inbound events. Resolves once the transport is ready (server listening, consumer subscribed, etc.).

Returns​

Promise<void>