avh4/elm-format

Use stm-conduit for logging

Open

#788 opened on 2023年2月11日

GitHub で見る
 (0 comments) (0 reactions) (0 assignees)Haskell (1,329 stars) (148 forks)batch import
help wantedmaintenance

説明

From https://github.com/avh4/elm-format/pull/770#issuecomment-1230725117, this is a low-priority issue to try using a cleaner design for coherent logging now that we process files in parallel.

The user-visible goal of this is to restore the pre-0.8.6 feature of elm-format --validate streaming the log output as it progresses, instead of the 0.8.6 behavior of waiting until all files are processed before printing the log.

To capture my incomplete thoughts on this:

  • the World action for validating a file should return Either (Loggable info) ()
  • the mapMConcurrently will need to be orchestrated from a new thread so that the main thread can listen for results and to the logging (and manage the state of the streaming JSON output)
  • the Eithers should be sent via an stm queue (preferably a bounded queue, most likely TBMQueue) to the main thread
  • probably conduit and stm-conduit are worth making use of

コントリビューターガイド