GithubHelp home page GithubHelp logo

immortal's Introduction

immortal's People

Contributors

alexeyzab avatar jfischoff avatar mitchellwrosen avatar unkindpartition avatar vaibhavsagar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

immortal's Issues

Be able to wait for a Immortal thread to finish.

For graceful shutdown, I wait for threads to finish in my servers main loop. I would like to do the same with Immortal threads.

I changed the definition to

data Thread = Thread ThreadId (IORef Bool) (TMVar ())

and added the function

wait :: Thread -> IO ()
wait (Thread _ _ finished) = atomically $ takeTMVar finished >> putTMVar finished ()

Should I put together a pull request?

Replace `MonadBaseControl` with `MonadUnliftIO`

Hi, would you accept a patch that replaces the dependency on monad-control with unliftio-core? (MonadBaseControl m -> MonadUnliftIO m).

The docs for immortal read:

The monadic «state» (captured by the MonadBaseControl instance) will be preserved if the computation terminates normally, and reset when the exception is thrown, so be cautious when m is stateful. It is completely safe, however, to instantiate m with something like ReaderT conf IO to pass configuration to the new thread.

which is the problem MonadUnliftIO is meant to solve.

Bound threads

What do you think about adding support for bound threads?

I tried simply changing forkIO to forkOS and it seems to work fine on my machine (although the -threaded GHC option is now needed).

(Use case: call C functions that require bound threads.)

Reupload Haddocks to Hackage

I just noticed that the hackage readme example (for both v0.2.2 and v0.2) references System.Immortal as the main example, while immortal's main module has always been at Control.Immortal. So I think this means that the haddocks just need to be re-uploaded? I'm a little fuzzy on how this would work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.