Replies: 1 comment 2 replies
-
You can use event.waitUntil(() => {
// Runs in the background after the response
// Broadcast a message to all clients
})
return "Hello, World!" |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using H3 and have a few routes that would be much faster If I could send the response sooner but still do some other work after.
An example is when a user sends a messages, the message is saved on the db and a response is sent. Then the message is also broadcasted with WebSocket but this happens after the message was sent so to not hang the request for an unrelated thing.
Beta Was this translation helpful? Give feedback.
All reactions