Cloudflare Developers

CD

Cloudflare Developers

Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news

Join
Aavsaase4/8/2024

OTel Rust worker

How do I set up open telemetry for my Rusty worker? I found an sdk and some guides to do it for a JS worker but how do you do this for Rust?
Aavsaase4/4/2024

Leptos SSR app

Has anyone tried to run a leptos SSR app from a worker or from pages? It seems easy enough to run the server side code from a worker but how do you include static files like css?
Aavsaase4/3/2024

workers-rs repo RA feature detection

Does anyone else have the problem that rust-analyzer doesn't properly detect the enabled features in the examples in the workers-rs repo?
Aavsaase4/2/2024

axum/examples/tracing-aka-logging/src/ma...

Thanks. I'm trying to get this working combined with the tracing example in the axum repo https://github.com/tokio-rs/axum/blob/main/examples/tracing-aka-logging/src/main.rs When I add TraceLayer::new_for_http() to my router I get a runtime panic saying time not implemented on this platform. Makes sense of course but I wonder if we can get that working some other way....
Ddakom4/2/2024

opened a PR to allow native web_sys

opened a PR to allow native web_sys request, without having to ditch the event macro: https://github.com/cloudflare/workers-rs/pull/525
Aavsaase4/1/2024

http w/o axum

Alright, got it working: ```rust use http::{Response, StatusCode}; use worker::{event, Context, Env, HttpRequest}; ...
Aavsaase3/27/2024

@kflansburg is there a specific reason

@kflansburg is there a specific reason you removed this re-export in PR 481?
pub use crate::schedule::*;
pub use crate::schedule::*;
...
Ddakom3/27/2024

Calling async code in sync trait

you can't turn async into sync in JS[1], but you can turn sync into async. I think what @kflansburg is poking around is that maybe you can think of a creative way to work around the type limitations of the trait in Rust, to turn it into some async thing you can use (or a sync thing you can poll).... but it's hard to see exactly what that would look like without seeing all the limitations you're facing. afaict this is not too far away from my channels solution above (which also turns sync+async into simple async in pure rust), and you're ultimately stuck from any of these ideas because you're somehow completely constrained by not having any async call-site where you can handle things. [1] in other words, you can turn "something that happens now" into "something that happens in the future" by delaying it, but it's logically impossible to turn "something that happens in the future" into "something that happens now". The best you can do is "keep looping now, don't move forward, until that future event happens, just loop until we get to the future" - but you can't do that either because it's not really about time, it's about driving the process forward- and by looping you prevent that progress from being made (it's just stuck in the loop, nothing else can happen). The way around that is to put the thread to sleep so that progress can be made while you loop, but the workers environment disables the ability to do this for security reasons. So, all in all, there is no way at all to turn async into sync in the workers environment, as long as those security restrictions are in place....
Aavsaase3/26/2024

V0.0.22

@kflansburg just out of curiosity, are there any more changes you want to have merged before cutting a new release?
EEnduriel3/25/2024

D1PreparedStatement API

the conversion from D1Type -> JsValue is done once per item per row, which means that every time you call bind_refs, all the D1Types have to be converted. Say we have 4 things we want to bind, and 2 are static, this means that every time we are passing all 4 to js and back. If we're clever with our iterator and are able to use jsvalue, we can instead always return the same 2 references to the static jsvalues and and only convert the 2 dynamic ones every bind_refs...
Aalex35mil11/30/2023

How to send `FormData` via `Fetch`? I

How to send FormData via Fetch? I don't see Into<JsValue> implementation on the FormData struct.
SSam10/24/2023

Yeah had a few problems with the smart

Yeah had a few problems with the smart pointers a while ago as well. But I'll give it another go. My problem right now though is that I can't call self from within the event handler.
SSam10/19/2023

GitHub - rasviitanen/rustysignal: Signal...

Hey guys trying to build a Signalling Server with Rust based on this repo: https://github.com/rasviitanen/rustysignal/tree/master Facing some issues when accounting for worker-rs instead. ...
Rradix10/17/2023

Does anyone know of any chat like

Does anyone know of any chat-like workers-rs example for websockets & durable objects? I'm trying to figure out the communication between different sockets and an example would help a lot 🙂 The only examples I've found are trivial echo servers
Rradix10/12/2023

I ve noticed that a panicking Durable

I've noticed that a panicking Durable Object causes the Worker that's calling it to just hang indefinitely. I'm guessing that the DO just aborts and somehow the socket connection isn't even getting cleanly shut down or something, so the worker doesn't even know that anything is wrong until it times out. Is there a way to change this behavior?
JWNJustin (will never dm)9/9/2023

Modifying Request Host

👋 heyo I'm trying to create a simple worker that takes a request and replaces the host. I have a basic worker running but i want it to be able to pass through the body, all the headers and anything else custom in the original request (e.g. the ip)....
MMetalGear6/17/2023

So if you were me a one man team

So if you were me a one man team developing a saas that’s using cloudflare workers and durable objects. I’m building a restaurant saas and have so many different solutions i plan to offer. I’m currently building the api to serve the client react native app in typescript cf workers and durables. Should I put in the backlog that I need to rebuild that using rust in cf workers and durables? What are the drawbacks of rust being used in cf workers? What are the missing features that forced u to switc...
Next