cfworker | packages optimized for Cloudflare Workers | Key Value Database library
kandi X-RAY | cfworker Summary
kandi X-RAY | cfworker Summary
A collection of packages optimized for Cloudflare Workers and service workers.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of cfworker
cfworker Key Features
cfworker Examples and Code Snippets
Community Discussions
Trending Discussions on cfworker
QUESTION
My published Cloudflare Worker (wrangler publish --env environment_name
) is timing out for clients, but not when
- running locally (e.g. by using cfworker, a nice tool to emulate cloudflare workers locally)
- or running in preview (
wrangler preview --env environment_name
).
A summary of my worker:
...ANSWER
Answered 2021-May-29 at 22:18It turns out that addEventListener
cannot be passed an async function (or one that returns a promise). The fetchEvent.respondWith
does accept a promise however. This is not written in the documentation, but I discovered this in lib.webworker.d.ts
.
To do asynchronous work, you must return a promise to fetchEvent.respondWith
instead:
- Pass a promise to
respondWith
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install cfworker
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page