bret_pat
bret_pat
Explore posts from servers
CDCloudflare Developers
Created by bret_pat on 4/6/2024 in #workers-help
Worker "isSecureContext" is set to false locally
Hi! A library that I'm using uses the Web Crypto API which checks (!globalThis.isSecureContext) which fails while developing locally. It seems like worker's aren't running in a secure context. Is there some sort of setting that I need to change which will fix this?
3 replies
CDCloudflare Developers
Created by bret_pat on 5/3/2023 in #workers-help
Rust worker, cannot build default project
New project, ran
pnpm create cloudflare workers worker-rust
pnpm create cloudflare workers worker-rust
and I'm trying to run
pnpm wrangler dev
pnpm wrangler dev
but I get an error
Running custom build: cargo install -q worker-build && worker-build --release
error[E0658]: use of unstable library feature 'bool_to_option'
Running custom build: cargo install -q worker-build && worker-build --release
error[E0658]: use of unstable library feature 'bool_to_option'
I'll add my toml to a separate post
3 replies
CDCloudflare Developers
Created by bret_pat on 5/1/2023 in #pages-help
next-on-pages and modifying routes
So I only want page functions to run whenever I hit my nextjs API route, how can I do this?
9 replies
CDCloudflare Developers
Created by bret_pat on 4/13/2023 in #workers-help
Orchestrate long running workers
Background information I have a business use case that I'm trying to figure out how to implement in workers or if workers aren't a good solution for my situation. A user can start a long running task that consists of many sequential third party api calls. We want this long running task to be both cancellable (in case the user changes their mind mid-way), and throttle-able across all users so that we don't bring down the 3rd part API. We'd want to know when a task has officially cancelled and not just when the cancel as requested, since we would likely want to start a new task after the previous one has officially completed. Current thoughts on implementation We'd have to break down our long running task into multiple sequential workers for a specific task, so that one continues after the previous one has ran out of CPU time. The biggest CPU sink would be just parsing the json that we get from the 3rd party api. Maybe a durable object (that shows which tasks should be active) + a queue that has all of the requests of long running tasks? How would we be able to implement a long-running task consisting on multiple sequential workers, prerably bundled since we're mostly waiting on API calls?
2 replies