[Haskell-cafe] ANNOUNCE: enumerator 0.4.8

Ertugrul Soeylemez es at ertes.de
Mon Mar 28 06:45:23 CEST 2011


John Millikin <jmillikin at gmail.com> wrote:

> Good idea -- I've added an ``enumSocketTimed`` and ``iterSocketTimed``
> to the network-enumerator package at <
> http://hackage.haskell.org/package/network-enumerator
> >. ``enumSocketTimed`` is equivalent to your ``enumHandleTimeout``,
> but instead of Handle uses the more efficient Socket type.

For simple applications working with handles is much more convenient, so
I decided to implement a timed handle enumerator instead of a socket
enumerator.

Perhaps it would be a good idea to add your 'enumSocketTimed' and
'iterSocketTimed' to my netlines package, too.  Also I should add
'iterHandleTimeout'.


> For setting a global timeout on an entire session, it's better to wrap
> the ``run_`` call with ``System.Timeout.timeout`` -- this is more
> efficient than testing the time on every chunk, and does not require a
> specialised enumerator.

It may be more efficient, but I don't really like it.  I like robust
applications, and to me killing a thread is always a mistake, even if
the thread is kill-safe.


Greets,
Ertugrul


-- 
nightmare = unsafePerformIO (getWrongWife >>= sex)
http://ertes.de/





More information about the Haskell-Cafe mailing list