You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How do i use it to Overcome Timeouts in Node.js? my application contains a time-consuming function, the response of which I don't require immediately, but I still want it to execute its tasks. How can I ensure that I receive the API response while allowing the function to execute in the background?
Can Inngest help me to do this? How can i do that for example if "performTask" function is at time-consuming function and I want to run it in the background and also make sure that the performTask API gives a response that performTask is started to run.
const express = require('express');
const app = express();
async function performTask() {
// Long Task Function
}
app.get('/performTask', async (req, res) => {
try {
performTask();
res.status(200).json({ message: "Function is called and it will do its job" });
} catch (error) {
res.status(500).json({ message: 'Error occurred', error });
}
});
The text was updated successfully, but these errors were encountered:
How do i use it to Overcome Timeouts in Node.js? my application contains a time-consuming function, the response of which I don't require immediately, but I still want it to execute its tasks. How can I ensure that I receive the API response while allowing the function to execute in the background?
Can Inngest help me to do this? How can i do that for example if "performTask" function is at time-consuming function and I want to run it in the background and also make sure that the performTask API gives a response that performTask is started to run.
The text was updated successfully, but these errors were encountered: