input-output-hk / cardano-rt-view

RTView: real-time watching for Cardano nodes (ARCHIVED)
Apache License 2.0
59 stars 11 forks source link

CAD-2199: STM instead of MVar for nodes state #76

Closed denisshevchenko closed 4 years ago

denisshevchenko commented 4 years ago

Currently, RTView uses MVar to store the internal state of nodes. Instead, STM should be used:

  1. Less dependencies: RTView already uses stm package, so if we remove MVar, the package strict-concurrency will be removed from dependencies.
  2. Atomic writing: now two threads will be writing to this state, so it should use atomic modify.