Skip to content
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

Print warning when we detect a non-main-thread main #3774

Merged
merged 3 commits into from
Sep 2, 2023

Conversation

Daenyth
Copy link
Contributor

@Daenyth Daenyth commented Aug 4, 2023

This should help people not run facefirst into sbt/sbt#6242
It's a frequent question for new users

* isn't the main process thread. This condition can happen when we are running inside of an
* `sbt run` with `fork := false`
*/
private def onNonMainThreadDetected(): Unit = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This can probably become protected in the next API break, though honestly I'm skeptical that it's valuable to expose at all

Copy link
Member

Choose a reason for hiding this comment

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

Yeah I'd rather not expose an API like this in IOApp. :-) Better to keep it private.

This should help people not run facefirst into sbt/sbt#6242
It's a frequent question for new users
@Daenyth Daenyth marked this pull request as ready for review August 5, 2023 00:40
Co-authored-by: Arman Bilge <armanbilge@gmail.com>
* isn't the main process thread. This condition can happen when we are running inside of an
* `sbt run` with `fork := false`
*/
private def onNonMainThreadDetected(): Unit = {
Copy link
Member

Choose a reason for hiding this comment

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

Yeah I'd rather not expose an API like this in IOApp. :-) Better to keep it private.

core/jvm/src/main/scala/cats/effect/IOApp.scala Outdated Show resolved Hide resolved
Copy link
Member

@djspiewak djspiewak left a comment

Choose a reason for hiding this comment

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

Wrong button on previous review sorry

Co-authored-by: Daniel Spiewak <djspiewak@gmail.com>
@armanbilge armanbilge merged commit d2759d5 into typelevel:series/3.5.x Sep 2, 2023
27 of 36 checks passed
@Daenyth Daenyth deleted the sbt-fork-damnit branch October 2, 2023 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants