(protocol)
| 431 | // Ensures that responses get sent back in the same order the requests were |
| 432 | // received |
| 433 | function processResponses(protocol) { |
| 434 | let ret; |
| 435 | while (protocol[SYM_REQS].length) { |
| 436 | const nextResponse = protocol[SYM_REQS][0][SYM_RESP]; |
| 437 | if (nextResponse === undefined) |
| 438 | break; |
| 439 | |
| 440 | protocol[SYM_REQS].shift(); |
| 441 | ret = protocol.push(nextResponse); |
| 442 | } |
| 443 | return ret; |
| 444 | } |
| 445 | |
| 446 | const SYM_TYPE = Symbol('Inbound Request Type'); |
| 447 | const SYM_RESP = Symbol('Inbound Request Response'); |