Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Rewrite paragraph
  • Loading branch information
loewenheim committed Aug 16, 2023
commit 5b1328743c41499e457ebd97cfd859ff2b26d0d6
2 changes: 1 addition & 1 deletion src/platforms/rust/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ let _guard = sentry::init(("___PUBLIC_DSN___", sentry::ClientOptions {

### Async Main Function

The Sentry client must be initialized before any async runtime is started or threads are spawned. Unfortunately, this makes it impossible to use macros such as `#[tokio::main]` or `#[actix_web::main]`, because they start the runtime first. Thus, instead of
In a multithreaded application, spawned threads should inherit the Hub from the main thread. In order for that to happen, the Sentry client must be initialized before starting an async runtime or spawning threads. This means you'll have to avoid using macros such as `#[tokio::main]` or `#[actix_web::main]`, because they start the runtime first. So rather than doing this:

```rust {filename:main.rs}
// WRONG
Expand Down