Skip to content

nooschain v0.1.0


nooschain / net/transports/in-process-transport / InProcessTransport

Class: InProcessTransport

Defined in: net/transports/in-process-transport.ts:14

Publish/subscribe transport backed by a local EventEmitter.

Implements

Constructors

Constructor

new InProcessTransport(): InProcessTransport

Returns

InProcessTransport

Properties

mode

readonly mode: "in_process"

Defined in: net/transports/in-process-transport.ts:16

Identifies this transport as the in-process implementation.

Implementation of

NetworkTransport.mode

Methods

getPeers()

getPeers(): Promise<object[]>

Defined in: net/transports/in-process-transport.ts:69

Returns no peers because the in-process transport does not track discovery or connectivity state.

Returns

Promise<object[]>

Implementation of

NetworkTransport.getPeers


publish()

publish(topic, message): Promise<void>

Defined in: net/transports/in-process-transport.ts:42

Emits a message to all local subscribers for a topic.

Parameters

topic

string

message

NetworkMessage

Returns

Promise<void>

Implementation of

NetworkTransport.publish


start()

start(): Promise<void>

Defined in: net/transports/in-process-transport.ts:27

Enables message publishing for this transport instance.

Returns

Promise<void>

Implementation of

NetworkTransport.start


stop()

stop(): Promise<void>

Defined in: net/transports/in-process-transport.ts:34

Disables publishing and removes all local topic subscriptions.

Returns

Promise<void>

Implementation of

NetworkTransport.stop


subscribe()

subscribe(topic, handler): Promise<void>

Defined in: net/transports/in-process-transport.ts:56

Registers a local async topic handler.

Handler failures are intentionally detached from the EventEmitter call site; tests using this transport should assert handler behavior directly.

Parameters

topic

string

handler

(message) => Promise<void>

Returns

Promise<void>

Implementation of

NetworkTransport.subscribe

Audience-first NOOSChain documentation.