Where to deploy with long-polling functions #2410
Unanswered
CodyBontecou
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm a bit confused where Nitro hangs out in the deployment space and how these deployed environments manage setInterval alongside Nitro endpoints.
I have a function that runs every 10 seconds and is currently managed in Nitro like so:
Does this run for a few seconds every interval, or is the
setInterval
creating a long-running process that is never killed until the setInterval is killed usingclearInterval(intervalId)
?I imagine the latter would get expensive quickly in a serverless environment. Or, am I overthinking this?
My understanding is serverless is ideal for short-running bits of code, not for long-running processes, and in fact, serverless providers tend to have a time-limit on long-running code. Is there a more ideal way to deploy a Nuxt application that utilizes Nitro extensively and doesn't depend on a serverless backend?
p.s. This is within a Nuxt application and ideally, I can deploy it bundled together.
Beta Was this translation helpful? Give feedback.
All reactions