On this page
Overview
Implements deterministic in-memory thread/message/send behavior for demos and tests.
- Artifact
InMemoryCommunicationProvider.js· esm - Classification
public first party - Availability
Cross-host - Normalization
Normalized communication entities.
Import and lifecycle
import inMemoryCommunicationProvider from '/arcane/modules/InMemoryCommunicationProvider.js';
Construction clones supplied entities into mutable in-memory thread/message state. send() appends one outbound message and advances a per-instance sequence; there is no I/O or global installation.
Application-facing behavior: default provider with listThreads(), getMessages(), send().
Protocol and host implementation
In-process only This detail does not widen the application-facing API or grant authority.
Exports, signatures, parameters, and results
| Binding | Form | Declaration or signature | Parameter syntax |
|---|---|---|---|
default | default · class | class InMemoryCommunicationProvider | — |
| Callable | Kind | Exact public signature | Parameter syntax |
|---|---|---|---|
InMemoryCommunicationProvider.listThreads | public-member | async listThreads() | — |
InMemoryCommunicationProvider.getMessages | public-member | async getMessages(threadId) | threadId |
InMemoryCommunicationProvider.send | public-member | async send({threadId,channel='other',body,recipients=[]}={}) | {threadId,channel='other',body,recipients=[]}={} |
| Member | Kind | Exact public declaration | Parameter syntax |
|---|---|---|---|
InMemoryCommunicationProvider.constructor | constructor | constructor({id='demo-provider',label='Demo provider',channels=['other'],threads=[],messages={}}={}) | {id='demo-provider',label='Demo provider',channels=['other'],threads=[],messages={}}={} |
InMemoryCommunicationProvider.listThreads | async method | async listThreads() | — |
InMemoryCommunicationProvider.getMessages | async method | async getMessages(threadId) | threadId |
InMemoryCommunicationProvider.send | async method | async send({threadId,channel='other',body,recipients=[]}={}) | {threadId,channel='other',body,recipients=[]}={} |
Parameter meanings and results
new Provider({id,label,channels,threads,messages}); listThreads() resolves CommunicationThread[]; getMessages(threadId) resolves CommunicationMessage[]; send({threadId,channel='other',body,recipients=[]}) resolves a CommunicationMessage with a generated id/timestamp and status 'sent'.
Events, side effects, and errors
Source-literal CustomEvent dispatches
No source-literal CustomEvent dispatch is part of this artifact.
Lifecycle and event flow
This artifact has no additional documented lifecycle event flow.
Direct coded failures
This artifact directly assigns no stable coded failure.
Exported Error subclasses
This artifact exports no Error subclass.
Documented failure behavior
- CommunicationThread and CommunicationMessage validation errors propagate.
Availability and capabilities
Cross-host. Normalized communication entities.
None; this is a deterministic in-process provider.
Contract example
import Provider from '/arcane/modules/InMemoryCommunicationProvider.js';
const provider = new Provider({id:'demo', label:'Demo'});
console.log(await provider.listThreads());
Related reference
No direct Core call is claimed for this artifact. Any injected provider or consuming module retains its own documented authority.