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
Next Next commit
Update src/platforms/rust/index.mdx
Co-authored-by: Liza Mock <[email protected]>
  • Loading branch information
loewenheim and lizokm authored Aug 16, 2023
commit 0c9995fe64b9da7c755c2dc604e36b7cb56c66b1
2 changes: 1 addition & 1 deletion src/platforms/rust/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ let _guard = sentry::init(("___PUBLIC_DSN___", sentry::ClientOptions {

**Important:** Note your DSN. The DSN (Data Source Name) tells the SDK where to send events. If you forget it, view Settings -> Projects -> Client Keys (DSN) in sentry.io.

### Async main function
### 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
The Sentry client must be initialized before any async runtime is started, otherwise threads will be spawned. 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:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, here my formulation was clearly ambiguous. I meant "The Sentry client must be initialized before (any async runtime is started or threads are spawned)".

How does

The Sentry client must be initialized before starting an async runtime or spawning threads.

sound?


Expand Down