(method, parameters)
| 110 | } |
| 111 | |
| 112 | post(method, parameters) { |
| 113 | const msg = { |
| 114 | id: this._nextCommandId++, |
| 115 | method |
| 116 | }; |
| 117 | if (parameters) |
| 118 | msg.params = parameters; |
| 119 | |
| 120 | return new Promise((resolve, reject) => { |
| 121 | this._requestCallbacks.set(msg.id, [resolve, reject]); |
| 122 | this._parentSession.post('NodeWorker.sendMessageToWorker', { |
| 123 | sessionId: this._id, message: JSON.stringify(msg) |
| 124 | }); |
| 125 | }); |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | async function testBasicWorkerDebug(session, post) { |