[Haskell-cafe] Conduit & state
michael at snoyman.com
Sat Jul 19 22:08:33 UTC 2014
Keep in mind that a State monad won't necessarily play nicely with a
multithreaded server. In particular, each new connection will have its
state set at the point the state was at when the server started, and
modifications from each child thread will be discarded. (That's assuming
you do something like using monad-control.) Depending on your actual needs,
you may instead want to store the priority queue in some kind of a mutable
variable, so that the child threads are able to update the state for other
On Fri, Jul 18, 2014 at 4:15 PM, Павел Гаврилов <lghtfck at gmail.com> wrote:
> I have:
> runUnixServer (serverSettings socket) $ \appData ->
> appSource appData
> $$ CL.map handleBS
> =$ appSink appData
> I want to store some data in priority queue in Monad.State and be able to
> access it inside the handleBS (now: handleBS :: ByteString -> ByteString).
> Can you send me on the right path?
> Thanx, Pavel.
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe