-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix(rust): Add warning about #[tokio::main] #7633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
bb82c2b
22a7866
9fbbdda
0c9995f
7809ade
136772d
5b13287
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Co-authored-by: Liza Mock <[email protected]>
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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 | ||||||
|
||||||
| 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: |
There was a problem hiding this comment.
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?
Uh oh!
There was an error while loading. Please reload this page.