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

Use Global EC for CatsResource #555

Open
wants to merge 2 commits into
base: series/1.x
Choose a base branch
from

Conversation

import scala.concurrent.duration._

trait CatsResourceIO[A] extends CatsResource[IO, A] with RuntimePlatform { this: FixtureAsyncTestSuite =>

override implicit def executionContext: ExecutionContext = ExecutionContext.global
Copy link
Author

Choose a reason for hiding this comment

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

Without this CatsResourceAllocationSpecs will fail

@bcarter97 bcarter97 force-pushed the 300-serial-ec-for-resource-suite branch from edef036 to 084f7ee Compare March 9, 2024 20:59
@bcarter97
Copy link
Author

bcarter97 commented Mar 9, 2024

Can't use the Global EC for Scala JS - don't have any experience with ScalaJS, should I follow the recommendation and use scala.scalajs.concurrent.JSExecutionContext.queue or is there a preferred method

After changing to use JS Global EC, it seems a bunch of imports aren't working (to do with the Scalatest Eventually trait). This is required to check the Resource is shutdown correctly. I think it would be possible to add a rudimentary eventually impl that doesn't require the Eventually trait, but I'd like some clarification on the approach

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.

CatsResourceIO in scalatest doesn't release the resource
1 participant