sentry-rust
sentry-rust copied to clipboard
WASM Support PR
trafficstars
I have Sentry working with WASM (on Cloudflare workers) with a custom Transport implementation. However, for it to compile with Sentry a few changes had to be made. These are minor changes and I am wondering if you guys are open to accept a PR with these changes. I describe them below.
- Replace
std::timewithweb_time - Remove
unwraponSessionFlusheressentially making it fail silently. Threads are not supported in Wasm and the flushing mechanism will have to be implemented by the Transport itself. For CloudFlare workers, for example, this is done usingwait_untilwhich spawns a child process to send the envelope.
Overall, the changes are minor and can be gated behind a "wasm" feature. Integrations will have to be changed/upgraded individually but this could be a starting point.