@niwinz FYI I'm getting very close to get promesa to run with bb, which is cool because some important libraries are using it, which could then also run with bb. Hope you're in for a bb compatibility PR when I'm done :)
oh yes, it depends currently on a dev build of bb, since LinkedList wasn't in there. let me fix that with a temp override
I pushed a fix for the failing CLJS tests too (I guessed that the test would be similar to the CLJ test) https://github.com/funcool/promesa/pull/161 Ready for review
I have made the csp + channel stuff working in bb as well. I found a project that used it so I thought, let's just fix it where possible.
$ bb -cp src:test -e "(require '[promesa.tests.exec-csp-test]) (clojure.test/run-tests 'promesa.tests.exec-csp-test)"
Testing promesa.tests.exec-csp-test
Ran 14 tests containing 66 assertions.
0 failures, 0 errors.
{:test 14, :pass 66, :fail 0, :error 0, :type :summary}
The only thing I needed to to is remove metadata support for channels (only for bb) and to remove the ISeq support (only for bb) and make chan->seq public
PR upcoming if you're interested👍🏽
of course :D
@niwinz Awesome. I had a PR ready but I changed binding conveyance to bound-fn* which is probably not correct (in the sense that it ruins the performance gain for virtual threads). I'm now working on making clojure.Var/resetThreadBindingFrame etc working on bb, so I'll make the PR somewhat smaller
nice, just a question, is bb supports conditional reder? i mean for a first approach we can think on use reader conditionals for make the code use bound-fn* on bb if it does not supports the var api for now
later we can iterate on it for make it also more efficient on bb or maybe it is enough for bb scripting the bound-fn solution
babashka actually also has clojure.core/binding-conveyor-fn so we could also use that. Perhaps we can just use it in JVM Clojure too? like
(def ^:private binding-conveyor-fn* @#'clojure.core/binding-conveyor-fn) hmm looks reasonable
There aren't actually any tests in promesa that fail when you don't convey the bindings
noup, the test suite is not complete as it should be
ok. also the CLJS tests are failing but you're probably aware of that?
I did fix some CI thingie for CLJS in the PR
yep, thanks, i still have some checks before releasing 12.0
@niwinz Cool, here's my PR then which works with bb as released today
(I cleaned up some unused imports while I was at it, hope you don't mind)
Looks very nice! I think it can be merged as-is.
i'm right now traveling so I think this week i can look to prepare the release a version
i mean I probably can't do it this weekend...
yeah sure, no problem!
when you think the pr is ready, i can merge it, i looked the code and the proposed changes are all OK for me
ready, I flipped the draft switch
merged
merged
🎉 Thanks a lot!
btw, the only namespace I tests were the core-tests, the rest I couldn't get to run (yet). But it seems the core namespace is the most widely used namespace anyway, right?
yes, the core is the main abstraction for promise object
other namespaces are more or les circumstantial
we use them a lot at penpot, the exec and CSP and bulkhead
yeah exec works, but bulkhead didn't I think.
$ bb -cp src -e "(require '[promesa.exec.bulkhead])"
----- Error --------------------------------------------------------------------
Type: clojure.lang.ExceptionInfo
Message: Protocol not found: clojure.core/Inst
Data: {:type :sci/error, :line 54, :column 1, :file "/Users/borkdude/dev/promesa/src/promesa/exec/bulkhead.clj"}
Location: /Users/borkdude/dev/promesa/src/promesa/exec/bulkhead.clj:54:1
Ah well, we'll fix that another day :)