configurapi-runner-ws 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/wsAdapter.js +3 -3
package/README.md
CHANGED
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
- Check `X-Stream-ID: $id` header for the stream ID. A chunk belonging to the same stream will have the same stream ID.
|
|
10
10
|
- connectionId is available at `event.request.headers.connectionId`
|
|
11
11
|
- `on_connect` and `on_disconnect` will be called when a new connection is made or closed.
|
|
12
|
-
- Use `Request.headers.
|
|
12
|
+
- Use `Request.headers.push-function` to send an out-of-band message. The function is async and accepts an object to send back to the caller.
|
package/package.json
CHANGED
package/src/wsAdapter.js
CHANGED
|
@@ -94,7 +94,7 @@ module.exports = {
|
|
|
94
94
|
|
|
95
95
|
if (ws.readyState === WebSocket.OPEN)
|
|
96
96
|
{
|
|
97
|
-
const headers = { 'X-Stream-
|
|
97
|
+
const headers = { 'X-Stream-ID': streamId, 'X-Stream': 'done' };
|
|
98
98
|
const response = new Response('', 204, headers);
|
|
99
99
|
|
|
100
100
|
ws.send(JSON.stringify(response), (err) =>
|
|
@@ -149,8 +149,8 @@ module.exports = {
|
|
|
149
149
|
request.params = data.params || {};
|
|
150
150
|
request.payload = data.payload || undefined;
|
|
151
151
|
|
|
152
|
-
request.headers['
|
|
153
|
-
request.headers['
|
|
152
|
+
request.headers['Connection-ID'] = ws.connectionId;
|
|
153
|
+
request.headers['Push-Function'] = async (data)=>await this.write(ws, data);
|
|
154
154
|
|
|
155
155
|
return request;
|
|
156
156
|
}
|