Replace use of SyncVar with Ref (support scala 2.13)
tgrospic opened this issue · comments
Overview
In Scala 2.13 SyncVar is removed so we need to switch to alternative. Another reason is to use functional abstraction which is Ref[F, A]
from cats library.
Solution
Replace objects defined as SyncVar
with Ref
concurrent mutable reference.
Each item should be in a separate PR.
- Replace objects to store report events in Reporting RSpace.
#3735
rchain/rspace/src/main/scala/coop/rchain/rspace/ReportingRspace.scala
Lines 114 to 115 in 2a52bd8
- Replace eventLog reference in RSpace base class.
#3736
- Replace produceCounters reference in RSpace base class. This one is little more involved.
COMM
constructor should return wrapped COMM object to calculate timesRepeated with F result.
- Replace installs reference in RSpace base class.
rchain/rspace/src/main/scala/coop/rchain/rspace/RSpaceOps.scala
Lines 87 to 91 in 8b9e315
- replace SyncVar with LinkedBlockingQueue as lock in Transport Layer test.
rchain/comm/src/test/scala/coop/rchain/p2p/EffectsTestInstances.scala
Lines 65 to 67 in aad68bd