SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

SAP HANA XS Advanced - Asynchronous Non-Blocking I/O within Node.js SAP HANA applications

Working with asynchronous connections

Overview

🎓 intermediate 15 min. SAP HANAIntermediateExpress Edition
Thomas Jung T Thomas Jung November 1, 2022
Created by September 16, 2016
Contributors

Prerequisites

Prerequisites

  • This tutorial is designed for SAP HANA on premise and SAP HANA, express edition. It is not designed for SAP HANA Cloud.
  • Proficiency: Intermediate
  • Tutorials: HANA Database Access from Node.js

Steps

Next Steps

Time to Complete

30 Min.


Step 1 Add second module require statement
โ€”

Return to the Node.js module and the index.js source file. Add a second module require statement for ./exerciseAsync

JavaScript
/*eslint no-console: 0, no-unused-vars: 0, no-undef:0, no-process-exit:0*/
/*eslint-env node, es6 */
"use strict";

module.exports = (app, server) => {
	app.use("/node", require("./routes/myNode")());
	app.use("/node/excAsync", require("./routes/exerciseAsync")(server));

	app.use( (err, req, res, next) => {
		console.error(JSON.stringify(err));
		res.status(500).send(`System Error ${JSON.stringify(err)}`);
	});
};
Step 2 Add an express route handler
+
Step 3 Create a test UI
+
Step 4 Enable websockets
+
Step 5 Create an async folder
+
Step 6 Create the Text Files
+
Step 7 Build and Run
+
Step 8 Test synchronous operations
+
Step 9 Test asynchronous operations
+
Step 10 More async tests
+
Step 11 Add more parallelism
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 11
1. Add second module require statement 2. Add an express route handler 3. Create a test UI 4. Enable websockets 5. Create an async folder 6. Create the Text Files 7. Build and Run 8. Test synchronous operations 9. Test asynchronous operations 10. More async tests 11. Add more parallelism

Learn more →