Fork me on GitHub
#funcool
<
2015-09-20
>
niwinz06:09:50

I understand, but in this case when you mixing deferred with either, you are delgating the error handling to either

niwinz06:09:04

the error notion of deffered can not contain left instances

niwinz06:09:49

the error notion of deffered can only contain exceptions so I thing if you want to combine the timeout aware deferreds with either you should handle 3 types of return values...

niwinz06:09:06

deferred[Left], deffered[Right] deffered[Exception]

niwinz06:09:39

I think that monad transformes doesn't make sense here...

niwinz06:09:14

In my opinion, if you are using deferred, just use its way to handle the error

niwinz06:09:46

Or... implement a different notion of timeout... instead of use the deferred builtin one

niwinz06:09:11

you can define your own timeout behavior that for example return a Left instance with some timeout related error inside

niwinz06:09:56

in this way, not using the builtin deferred timeout implementation, the transformers can be used without problems.

mccraigmccraig07:09:03

hmm, yes, a timeout returning a Left instance would work

mccraigmccraig15:09:02

niwinz: i did a PR to permit timeout values to be set as per discussion above

mccraigmccraig15:09:47

presumably the cats.labs.channel could be similarly extended with timeouts... i might take a look at that soon, i could do with some sane core.async timeout behaviour in the clojurescript bit of my project

niwinz15:09:54

nice work @mccraigmccraig

mccraigmccraig15:09:01

my little contribution in return for your nice work @niwinz simple_smile