Where is Managed

Blast from the past! I'm trying to hook up testcontainers (pg as it happens) so this example looks very relevant! Does anyone know what became of @effect-ts/core/Effect/Managed? Did that become Layer.scoped?
Just wondering how to write this today - here's my attempt before I found this 😛
      Layer.scoped(
        PostgresContainer,
        Effect.acquireRelease(
          Effect.promise(() =>
            new PostgreSqlContainer('postgres:16.3-alpine')
              .withWaitStrategy(
                Wait.forAll([
                  Wait.forListeningPorts(),
                  Wait.forLogMessage(
                    /.*database system is ready to accept connections.*/,
                    2,
                  ),
                ]),
              )
              .start(),
          ),
          (container: StartedPostgreSqlContainer) =>
            Effect.promise(() => container.stop()),
        ),
      ),
Was this page helpful?