InMemoryChannelSource
Defined in: channels/in-memory-channel-source.ts:26
A ChannelSource backed by in-memory arrays. No I/O, no timers — perfect for tests and the runnable example.
Implements
Constructors
Constructor
new InMemoryChannelSource(): InMemoryChannelSource;Returns
InMemoryChannelSource
Methods
emit()
emit(message): void;Defined in: channels/in-memory-channel-source.ts:52
Simulate an inbound message arriving on the socket. Use this from a test or example to drive traffic — including bursts, by calling it several times in a row synchronously.
Parameters
| Parameter | Type | Description |
|---|---|---|
message | InboundMessage | The inbound message to deliver. |
Returns
void
Throws
If called before start.
send()
send(target, text): void;Defined in: channels/in-memory-channel-source.ts:36
Post reply text back to a channel/thread.
Parameters
| Parameter | Type | Description |
|---|---|---|
target | OutboundTarget | Where the reply goes. |
text | string | The reply text. |
Returns
void
Implementation of
start()
start(onMessage): void;Defined in: channels/in-memory-channel-source.ts:32
Begin receiving. onMessage is invoked for every normalized inbound message
— the source must drain and ack its transport continuously and never stop
reading just because a run is in flight (that is what the bounded queue
downstream is for). Owns its own reconnect/heartbeat internally.
Parameters
| Parameter | Type | Description |
|---|---|---|
onMessage | (message) => void | Called per normalized inbound message. |
Returns
void
Implementation of
stop()
stop(): void;Defined in: channels/in-memory-channel-source.ts:40
Stop receiving and release the transport.
Returns
void
Implementation of
Properties
| Property | Modifier | Type | Default value | Description | Defined in |
|---|---|---|---|---|---|
sent | readonly | SentReply[] | [] | Every reply posted via send, in order. | channels/in-memory-channel-source.ts:28 |