rclnodejs 0.23.2 → 0.23.3
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/lib/service.js +10 -9
- package/package.json +2 -2
package/lib/service.js
CHANGED
|
@@ -75,17 +75,18 @@ class Service extends Entity {
|
|
|
75
75
|
|
|
76
76
|
const plainObj = request.toPlainObject(this.typedArrayEnabled);
|
|
77
77
|
const response = new Response(this, headerHandle);
|
|
78
|
-
|
|
78
|
+
Promise.resolve(this._callback(plainObj, response)).then((responseToReturn) => {
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
80
|
+
if (!response.sent && responseToReturn) {
|
|
81
|
+
responseToReturn = new this._typeClass.Response(responseToReturn);
|
|
82
|
+
const rawResponse = responseToReturn.serialize();
|
|
83
|
+
rclnodejs.sendResponse(this._handle, rawResponse, headerHandle);
|
|
84
|
+
}
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
debug(
|
|
87
|
+
`Service has processed the ${this._serviceName} request and sent the response.`
|
|
88
|
+
);
|
|
89
|
+
});
|
|
89
90
|
}
|
|
90
91
|
|
|
91
92
|
static createService(nodeHandle, serviceName, typeClass, options, callback) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rclnodejs",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.3",
|
|
4
4
|
"description": "ROS2.0 JavaScript client with Node.js",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"postinstall": "npm run generate-messages",
|
|
24
24
|
"docs": "cd docs && make",
|
|
25
25
|
"test": "node --expose-gc ./scripts/run_test.js && npm run dtslint",
|
|
26
|
-
"dtslint": "node scripts/generate_tsd.js
|
|
26
|
+
"dtslint": "node scripts/generate_tsd.js",
|
|
27
27
|
"lint": "eslint --max-warnings=0 --ext js,ts index.js types scripts lib example rosidl_gen rosidl_parser test benchmark/rclnodejs && node ./scripts/cpplint.js",
|
|
28
28
|
"format": "clang-format -i -style=file ./src/*.cpp ./src/*.hpp && prettier --write \"{lib,rosidl_gen,rostsd_gen,rosidl_parser,types,example,test,scripts,benchmark}/**/*.{js,md,ts}\" ./*.{js,md,ts}"
|
|
29
29
|
},
|