[Haskell-cafe] Conduit and pipelined protocol processing using a threadpool

Nicolas Trangez nicolas at incubaid.com
Tue Nov 27 18:25:00 CET 2012


Michael,

On Tue, 2012-11-27 at 17:14 +0200, Michael Snoyman wrote:
> I think the stm-conduit package[1] may be helpful for this use case.
> Each time you get a new command, you can fork a thread and give it the
> TBMChan to write to, and you can use sourceTBMChan to get a source to
> send to the client.

That's +- what I had in mind. I did find stm-conduit before and did try
to get the thing working using it, but these attempts failed.

I attached an example which might clarify what I intend to do. I'm aware
it contains several potential bugs (leaking threads etc), but that's
beside the question ;-)

If only I could figure out what to put on the 3 lines of comment I left
in there...

Thanks for your help,

Nicolas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pool.hs
Type: text/x-haskell
Size: 2408 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20121127/38245a45/attachment.hs>


More information about the Haskell-Cafe mailing list