Hi, could anyone explain me in simple

Hi, could anyone explain me in simple terms (I would have put ELIF), why I am getting this error in one worker:
Cannot perform I/O on behalf of a different request. I/O objects (such as streams, request/response bodies, and others) created in the context of one request handler cannot be accessed from a different request's handler. This is a limitation of Cloudflare Workers which allows us to improve overall performance.
Cannot perform I/O on behalf of a different request. I/O objects (such as streams, request/response bodies, and others) created in the context of one request handler cannot be accessed from a different request's handler. This is a limitation of Cloudflare Workers which allows us to improve overall performance.
5 Replies
Eusebio Trigo
Eusebio Trigo7mo ago
I'm requesting some promises from within my worker to another service, but that's pretty much it.
kian
kian7mo ago
Do you have a code example?
Eusebio Trigo
Eusebio Trigo7mo ago
I can give you an schema: request -> hono routes -> handler -> issue query to our db provider through the API, once we get the list of results (list of ids), we query more things from the db provider for each one of the results. All of those queries are requested thorugh async/await.
kian
kian7mo ago
The issue here is with the code - it means you have resources in the global scope that shouldn’t be there.
Eusebio Trigo
Eusebio Trigo7mo ago
Uhm, that could be. I'll need to review it, but that's a good lead. Thanks!
Want results from more Discord servers?
Add your server
More Posts