Skip to content

Conversation

@armanbilge
Copy link
Member

This is cherry-picked out of #4. Creates a core module containing IOSetup to abstract the one-time-resource-acquisition logic.

@armanbilge armanbilge requested a review from bpholt August 23, 2021 05:06
import cats.effect.kernel.Deferred
import cats.syntax.all._

private[feral] trait IOSetup {
Copy link
Member Author

Choose a reason for hiding this comment

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

Do we want to expose this outside of feral?

Comment on lines +30 to +32
protected def setup: Resource[IO, Setup] = Resource.pure(null.asInstanceOf[Setup])

private[feral] final lazy val setupMemo: IO[Setup] = {
Copy link
Member Author

@armanbilge armanbilge Aug 23, 2021

Choose a reason for hiding this comment

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

@djspiewak: @bpholt and I changed this to def / lazy val to avoid initialization errors, undoing your change in #1 to make setup a val. Is there a better way to handle this?

@armanbilge armanbilge merged commit cd131a4 into typelevel:main Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants