Haskell locks the lock

I am writing a server in Haskell, and I would like to explicitly close the client descriptor after disconnecting them. When I call hClose , the thread blocks until the Client closes its side of the handle. Is there any way to close it without locking?

Thanks in advance!

+6
source share
1 answer

Of course, just run it in another thread:

 import Control.Concurrent (forkIO) forkIO (hClose handle) 

As jozefg stated, you can use more convenient solutions, such as those found in async , but I see no reason in this case.

+10
source

All Articles