This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env runhaskell | |
-- This example uses the hslogger library. | |
-- For debugging it may be more convenient to use Debug.Trace instead since that | |
-- allows you to log debugging output from otherwise pure functions. | |
import System.IO (stderr, Handle) | |
import System.Log.Logger (rootLoggerName, setHandlers, updateGlobalLogger, | |
Priority(INFO), Priority(WARNING), infoM, debugM, | |
warningM, errorM, setLevel) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// v2 of the great example of SSE in go by @ismasan. | |
// includes fixes: | |
// * infinite loop ending in panic | |
// * closing a client twice | |
// * potentially blocked listen() from closing a connection during multiplex step. | |
package main | |
import ( | |
"fmt" | |
"log" |