Fork me on GitHub
#funcool
<
2023-02-06
>
niwinz09:02:49

my main idea is adding the ability to close channel with an error and an additional option or specific exception handler that leaves the user the option to close the channel with an error when the error is happening on the provided transducer. This also will make blocking take operations throw the exception and nonblocking returning rejected promise

mccraigmccraig21:02:43

that's the direction i was thinking in too

mccraigmccraig12:02:36

hmm - i have an issue with CSP stream transducers - looks like the finaliser arity is not getting called, which is causing some data to sometimes go missing with stateful transducers ... will investigate further

mccraigmccraig13:02:49

my test passes if i remove the (zero? (mlist/size @puts)) clause so that (add-fn buf) (which is the finaliser arity of any transducer) is always called on close! when there is a buffer ... https://github.com/funcool/promesa/blob/master/src/promesa/exec/csp/channel.cljc#L333 what does that clause guard against ? i'm not yet sure of the consequences of removing it or changing it...

niwinz16:02:02

that looks like legacy, when I have initially look on how core.async worked, because of the other topic we have talked previously: core.async does not clears the put queue. So this looks like a bug, and this condition should be removed

niwinz16:02:40

i guess this when is responsible of your bug

niwinz16:02:19

i'm right now a bit busy, but as soon as I return to promesa code I will fix it.

niwinz16:02:49

That when probably should be replaced with:

(some-> buf add-fn)

👍 2
mccraigmccraig16:02:08

yep - bug goes away when that bad clause is removed

niwinz16:02:00

thanks for confirming, I will remove it as soon as I return to promesa codebase

mccraigmccraig16:02:48

cool - dyu want me to do a PR ?

niwinz16:02:07

if you have time for it, i'm glad to accept it

👍 2
mccraigmccraig18:02:11

here u go - clj CI is broken, but it's broken on trunk too https://github.com/funcool/promesa/pull/135

niwinz18:02:10

yep, I know it is broken, don't worry i will fix that on my next promesa iteration 😛

👍 2