funcool

A channel for discussing and asking questions about Funcool libraries https://github.com/funcool/
niwinz 2015-09-20T06:50:22.000039Z

Hmm.

niwinz 2015-09-20T06:50:50.000040Z

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

niwinz 2015-09-20T06:51:04.000041Z

the error notion of deffered can not contain left instances

niwinz 2015-09-20T06:51:49.000042Z

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...

niwinz 2015-09-20T06:52:06.000043Z

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

niwinz 2015-09-20T06:52:39.000044Z

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

niwinz 2015-09-20T06:53:14.000045Z

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

niwinz 2015-09-20T06:53:46.000046Z

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

niwinz 2015-09-20T06:54:11.000047Z

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

niwinz 2015-09-20T06:54:56.000048Z

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

mccraigmccraig 2015-09-20T07:09:03.000049Z

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

mccraigmccraig 2015-09-20T15:31:02.000050Z

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

mccraigmccraig 2015-09-20T15:41:47.000051Z

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

niwinz 2015-09-20T15:47:54.000052Z

nice work @mccraigmccraig

niwinz 2015-09-20T15:47:58.000053Z

Thanks!

mccraigmccraig 2015-09-20T15:49:01.000054Z

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

niwinz 2015-09-20T15:49:33.000055Z

\o/