haskell-phrasebook icon indicating copy to clipboard operation
haskell-phrasebook copied to clipboard

Add example for threadsafe logging.

Open friedbrice opened this issue 5 years ago • 4 comments

Re: https://github.com/typeclasses/haskell-phrasebook/issues/14

friedbrice avatar Aug 18 '20 17:08 friedbrice

Re: https://github.com/typeclasses/haskell-phrasebook/issues/15, too.

friedbrice avatar Aug 18 '20 18:08 friedbrice

Finally getting back to this :sweat:

When run as an executable, not all the log messages get printed, because main doesn't join to the "sing" threads, so it quits before they finish. I'm considering using the async package instead of forkIO so we can have an easy facility to wait for thread termination.

chris-martin avatar Feb 22 '22 22:02 chris-martin

  (log, print) <- do

I probably shouldn't be shadowing Prelude symbols, either 🙃

I'll play with this today and push what i end up with.

friedbrice avatar Feb 24 '22 21:02 friedbrice

Hey, good to hear from you! Check out my PR, I've had some other thoughts as well.

chris-martin avatar Feb 24 '22 21:02 chris-martin