InMemoryNegotiationTransport
@totemsdk/edge / InMemoryNegotiationTransport
Class: InMemoryNegotiationTransport
Deterministic in-memory transport for tests and local/programmatic negotiation. Delivers messages synchronously to subscribed handlers, and returns a DeliveryReceipt when the handler is present (durably delivered).
Implements
Constructors
Constructor
new InMemoryNegotiationTransport():
InMemoryNegotiationTransport
Returns
InMemoryNegotiationTransport
Methods
getSent()
getSent():
object[]
Inspect delivered messages (for tests).
Returns
object[]
send()
send(
recipient,message):Promise<DeliveryReceipt|undefined>
Parameters
recipient
string
message
Returns
Promise<DeliveryReceipt | undefined>
Implementation of
subscribe()
subscribe(
handler):Unsubscribe
Parameters
handler
(message, context) => Promise<void>
Returns
Unsubscribe