Receiver
@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>