MCPcopy Index your code
hub / github.com/Sandpack/nodebox-runtime / on

Method on

packages/nodebox/src/modules/shell.ts:107–125  ·  view source on GitHub ↗
(message: 'exit' | 'progress' | 'error', listener: any)

Source from the content-addressed store, hash-verified

105 public async on(message: 'progress', listener: (status: WorkerStatusUpdate) => void): Promise<void>;
106
107 public async on(message: 'exit' | 'progress' | 'error', listener: any): Promise<void> {
108 switch (message) {
109 case 'progress': {
110 this.channel.on('worker/progress', ({ data }) => {
111 listener(data.status);
112 });
113 return;
114 }
115
116 case 'exit': {
117 this.channel.on('worker/exit', ({ data }) => {
118 if (data.workerId === this.id) {
119 listener(data.exitCode, data.error);
120 }
121 });
122 return;
123 }
124 }
125 }
126
127 /**
128 * Terminates the shell process.

Callers 3

watchMethod · 0.45
forwardStdEventsMethod · 0.45
waitForMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected