I'm using https://hackage.haskell.org/package/warp-3.3.24/docs/Network-Wai-Handler-Warp.html
I don't know much about haskell concurrency. Say I would like to run two servers on different ports:
So I do:
do
Warp.run 3000 waiApp
Warp.run 3002 waiApp
Then server is run on 3000 is working, but it never gets to the next line.
I tried:
do
forkIO $ Warp.run 3000 waiApp
forkIO $ Warp.run 3002 waiApp
But it doesn't seem to work, each of them just stop after forking.
How to make it work properly? Also I want to allow the code below to be executed aslo.
UPD:
So the current solution is just to add
forever (threadDelay 1000)
in the end of the main
, I wonder if it is the correct way to do this.