Use then-combine for Two Independent Futures
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start with blaze.async.comp/then-combine (added with #4384) and the four call sites listed: resource_cache.clj (merge-futures), token_token.clj and token_quantity.clj (-compile-value), and value_set/expand.clj (expand-compose*). Replace each two-future ac/all-of with then-combine, watching the swapped prefix-with argument order in token_quantity.clj. Leave validate_code.clj and any three-or-more-future all-of untouched. Done when the four sites compile and their existing tests pass.
Written by the indexing model from the issue text.
Description
blaze.async.comp/then-combine (introduced together with #4384) combines two independent CompletableFutures into one result. Several places still wait on exactly two independent futures with ac/all-of and join both afterwards. Replace them with then-combine:
modules/db/src/blaze/db/resource_cache.cljmerge-futures→(ac/then-combine futures-1 futures-2 merge)modules/db/src/blaze/db/impl/search_param/composite/token_token.clj-compile-value→(ac/then-combine f1 f2 bs/concat)modules/db/src/blaze/db/impl/search_param/composite/token_quantity.clj-compile-value→(ac/then-combine f1 f2 (fn [v1 v2] (prefix-with v2 v1)))(note the swapped argument order ofprefix-with)modules/terminology-service-local/src/blaze/terminology_service/local/value_set/expand.cljexpand-compose*→(ac/then-combine includes excludes (fn [includes excludes] ...))
Not in scope: all-of calls over three or more or a variable number of futures, and validate_code.clj, where the excludes lookup intentionally runs only after the includes succeeded and its failure is the success path.
- Dominant language
- Clojure
- Stars
- 230
- Forks
- 27
- Avg merge
- 9h 20m
- Merged PRs (30d)
- 149
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from samply/blaze
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Fix Flaky integration-test-kds Load Data StepMay be free again A pull request for this issue was closed without being merged. Openci
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
samply/blaze#4694 · 1 comment ·
Maintainers usually reply within 1 day
-
module:cql
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
module:db
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day
Similar issues
-
SUM over a union column should skip an undefined slot, not throw ArrayIndexOutOfBoundsExceptionOpenexpression engine unshaved-yak
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
WG adoption
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
.Needs Triage .Team/UXWest Priority:P3 Type:Bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
metabase/metabase#88625 · 1 comment ·
Maintainers usually reply within 1 day
-
clojure easy first-contributor first-contributors good first issue help wanted up-for-grabs
Difficulty 1/5 1-3 hours Newbie friendliness 94/100
fork-commit-merge/fork-commit-merge#8749 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
unclebob/uml-viewer#18 ·