Skip to content

API reference / @jsprismarine/script-host / debugger/channel / DebuggerChannelBridge

Class: DebuggerChannelBridge ​

Defined in: script-host/src/debugger/channel.ts:92

The connection thread's end of a channel. It delivers the extension's messages to the engine's thread and hands back what the session sends.

Constructors ​

Constructor ​

new DebuggerChannelBridge(): DebuggerChannelBridge

Defined in: script-host/src/debugger/channel.ts:98

Returns ​

DebuggerChannelBridge

Properties ​

endpoint ​

readonly endpoint: DebuggerChannelEndpoint

Defined in: script-host/src/debugger/channel.ts:94

The end to pass to the engine's thread, where a PortDebuggerChannel wraps it.

Accessors ​

closed ​

Get Signature ​

get closed(): boolean

Defined in: script-host/src/debugger/channel.ts:107

Whether either end has closed.

Returns ​

boolean

Methods ​

close() ​

close(): void

Defined in: script-host/src/debugger/channel.ts:141

Tells the engine's thread the connection closed, after the messages already delivered.

Returns ​

void


connect() ​

connect(connection): void

Defined in: script-host/src/debugger/channel.ts:133

Joins a connection to this bridge: the extension's messages go to the engine's thread, the session's go to the extension, and either side closing closes the other.

Parameters ​

connection ​

DebuggerConnection

Returns ​

void


deliver() ​

deliver(message): void

Defined in: script-host/src/debugger/channel.ts:112

Hands one message from the extension to the engine's thread, waking it if it waits.

Parameters ​

message ​

unknown

Returns ​

void


onClose() ​

onClose(listener): void

Defined in: script-host/src/debugger/channel.ts:125

Calls listener once when the engine's end closes.

Parameters ​

listener ​

() => void

Returns ​

void


onMessage() ​

onMessage(listener): void

Defined in: script-host/src/debugger/channel.ts:120

Calls listener with each message the session sends, on this thread's event loop.

Parameters ​

listener ​

(message) => void

Returns ​

void