Use our threads package .
import Control.Concurrent.Thread ( forkIO, wait_ )
myDBusThingie :: IO ()
myDBusThingie = error "TODO"
main :: IO ()
main = do tid <- forkIO myDBusThingie
But like David said, this is only usefull if you plan on multiple
concurrent waits or doing some other work during the wait. Otherwise
you can simply replace the contents of main with myDBusThingie.
1 - http://hackage.haskell.org/package/threads (new, backwards
compatible, version will be released soon)
On Mon, May 17, 2010 at 7:04 PM, DPX-Infinity <dpx.infinity@xxxxxxxxx> wrote:
> I'm writing a program which listens to some D-Bus signals using
> DBus.Client.onSignal function from dbus-client package. This function
> runs IO action in separate haskell thread when signal is received. My
> program does nothing except signal handling, so after setting up
> signals it has to wait indefinitely. Now I'm using not very clean (I
> think so) forever $ threadDelay 10000000 . Is there another (I mean,
> correct) method to do this thing?
> Haskell-Cafe mailing list
Haskell-Cafe mailing list