See yesodweb/wai#552
stack build
stack exec main
Open http://localhost:8000 in your browser after it's running.
Request timeline (~ms)
- (0) client opens websocket connection
- (0) server forks off pinger thread with 2s interval
- (1000) client closes websocket connection
- (1000) client initiates
/db
request - (1000) server opens Postgres connection, sleeps for 2s
- (2000) pinger thread sends on the (closed) websocket connection
- (3000) server runs a query on the Postgres connection, throws an exception about file descriptors