diff --git a/cypher/src/main/scala/com/arkondata/slothql/neo4j/Neo4jCypherTransactor.scala b/cypher/src/main/scala/com/arkondata/slothql/neo4j/Neo4jCypherTransactor.scala index 90e459a..da3d2c5 100644 --- a/cypher/src/main/scala/com/arkondata/slothql/neo4j/Neo4jCypherTransactor.scala +++ b/cypher/src/main/scala/com/arkondata/slothql/neo4j/Neo4jCypherTransactor.scala @@ -60,7 +60,7 @@ class Neo4jCypherTransactor[F[_]](protected val session: F[Session])( protected def blockerResource: Resource[F, Blocker] = Blocker[F] - protected def sessionResource: Resource[F, Session] = Resource.liftF(session) + protected def sessionResource: Resource[F, Session] = Resource.eval(session) // TODO: `Resource.make(session)(s => delay(s.close()))` fails; maybe fs2.Stream.resourceWeak should be used at `run`? // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // @@ -90,7 +90,7 @@ class Neo4jCypherTransactor[F[_]](protected val session: F[Session])( tx <- readTxAsResource(txVar) } yield tx - protected def transactionMVarResource: Resource[F, MVar[F, Transaction]] = Resource liftF MVar.empty[F, Transaction] + protected def transactionMVarResource: Resource[F, MVar[F, Transaction]] = Resource eval MVar.empty[F, Transaction] protected def execLockMVarResource(lock1: MVar[F, Option[Throwable]]): Resource[F, MVar[F, Boolean]] = { def waitClose = lock1.read.map(_.toLeft(())).rethrow @@ -101,7 +101,7 @@ class Neo4jCypherTransactor[F[_]](protected val session: F[Session])( } protected def closeLockMVarResource: Resource[F, MVar[F, Option[Throwable]]] = - Resource.liftF(MVar.empty[F, Option[Throwable]]) + Resource.eval(MVar.empty[F, Option[Throwable]]) protected def commitTransaction(tx: Transaction): F[Unit] = delay(tx.commit()) protected def rollbackTransaction(tx: Transaction): F[Unit] = delay(tx.rollback()) @@ -109,7 +109,7 @@ class Neo4jCypherTransactor[F[_]](protected val session: F[Session])( protected def backgroundWorkResource(work: F[Unit]): Resource[F, F[Unit]] = Concurrent[F].background(work) - protected def readTxAsResource(txVar: MVar[F, Transaction]): Resource[F, Transaction] = Resource.liftF(txVar.read) + protected def readTxAsResource(txVar: MVar[F, Transaction]): Resource[F, Transaction] = Resource.eval(txVar.read) // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // diff --git a/opentracing-neo4j/src/main/scala/com/arkondata/slothql/neo4j/TransactorTracing.scala b/opentracing-neo4j/src/main/scala/com/arkondata/slothql/neo4j/TransactorTracing.scala index 81d4a00..87f9c9f 100644 --- a/opentracing-neo4j/src/main/scala/com/arkondata/slothql/neo4j/TransactorTracing.scala +++ b/opentracing-neo4j/src/main/scala/com/arkondata/slothql/neo4j/TransactorTracing.scala @@ -107,9 +107,9 @@ object TransactorTracing { override protected def readTxAsResource(txVar: MVar[F, Transaction]): Resource[F, Transaction] = for { - span <- Resource liftF activeSpan[F] + span <- Resource eval activeSpan[F] tx <- super.readTxAsResource(txVar) - _ <- Resource liftF activateSpan(span) + _ <- Resource eval activateSpan(span) } yield tx protected def runInsideTxWork(span: Option[Span])(run: => Unit): Unit = run @@ -119,7 +119,7 @@ object TransactorTracing { txVar <- transactionMVarResource cLock <- closeLockMVarResource eLock <- execLockMVarResource(cLock) - span <- Resource liftF activeSpan[F] + span <- Resource eval activeSpan[F] runTx = ce.delay(run { tx => runInsideTxWork(span) { (for { diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 1178ed6..d35a35d 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -33,7 +33,7 @@ object Dependencies { lazy val macroParadise = "2.1.1" lazy val cats = "2.4.1" - lazy val catsEffect = "2.1.4" + lazy val catsEffect = "2.5.4" lazy val fs2 = "2.4.6" lazy val neo4jDriver = "4.2.0"