Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do i use it to Overcome Timeouts in Node.js? #637

Open
xts-bit opened this issue Sep 24, 2023 · 1 comment
Open

How do i use it to Overcome Timeouts in Node.js? #637

xts-bit opened this issue Sep 24, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@xts-bit
Copy link

xts-bit commented Sep 24, 2023

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 });
  }
});
@xts-bit xts-bit added the bug Something isn't working label Sep 24, 2023
@xts-bit
Copy link
Author

xts-bit commented Sep 24, 2023

@djfarrelly @anafilipadealmeida @goodoldneon Can you guys please help me to do this?

IGassmann pushed a commit that referenced this issue Feb 14, 2024
* INN-2625: Updated fan-out guide

* Update pages/docs/guides/fan-out-jobs.mdx

* Update pages/docs/guides/fan-out-jobs.mdx

* Update pages/docs/guides/fan-out-jobs.mdx

* Update pages/docs/guides/fan-out-jobs.mdx

* Update pages/docs/guides/fan-out-jobs.mdx

* Update pages/docs/guides/fan-out-jobs.mdx

* Update pages/docs/guides/fan-out-jobs.mdx

* Update pages/docs/guides/fan-out-jobs.mdx

* Update pages/docs/guides/fan-out-jobs.mdx

* Update pages/docs/guides/sending-events-from-functions.mdx

* Update pages/docs/guides/sending-events-from-functions.mdx

* Update pages/docs/guides/sending-events-from-functions.mdx

* Update pages/docs/guides/sending-events-from-functions.mdx

* Update pages/docs/guides/sending-events-from-functions.mdx

* Update pages/docs/guides/sending-events-from-functions.mdx

---------

Co-authored-by: Sylwia Vargas <45401242+sylwiavargas@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants