This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-03
Channels
- # announcements (5)
- # babashka (7)
- # beginners (119)
- # biff (4)
- # cider (7)
- # clj-kondo (26)
- # cljfx (3)
- # cljs-dev (2)
- # clojure (28)
- # clojure-austin (18)
- # clojure-europe (9)
- # clojure-france (6)
- # clojure-norway (4)
- # clojure-uk (3)
- # clojurescript (6)
- # community-development (1)
- # core-async (4)
- # cursive (9)
- # data-science (12)
- # datomic (13)
- # duct (18)
- # emacs (15)
- # etaoin (5)
- # events (13)
- # honeysql (46)
- # hyperfiddle (9)
- # jackdaw (5)
- # jobs (13)
- # keechma (4)
- # lsp (37)
- # malli (32)
- # nbb (14)
- # off-topic (10)
- # other-languages (2)
- # polylith (4)
- # programming-beginners (3)
- # reagent (27)
- # reitit (1)
- # shadow-cljs (32)
- # sql (11)
- # tools-build (5)
- # tools-deps (3)
- # vim (14)
- # xtdb (11)
I'm scratching my head a bit on using keechma-pipelines with a use-existing queue. The context is as follows. I have a pipeline which gets a "bucket" of data from a remote server. Each bucket has multiple entities worth of data. So one pipeline function :ensure-data is called with the entity required. If there are two entities whos data is stored in the same bucket, i only want one network request, but I cannot figure out how to run a sub-pipeline which returns the same bucket with a use-existing. Or rather, I can do that, but then the "value" in the pipeline cannot contain the entity details.
use-existing
will only return existing promise if there is a running pipeline called with the same arguments. You can achieve what you want with the combination of set-queue
and dropping
behavior: https://github.com/keechma/keechma-pipelines/blob/master/test/keechma/pipelines/core_test.cljs#L1629
In this case, no new pipelines will be started while there is a request in the queue. So, you can dynamically return a queue name based on the data that is used as the pipeline value. If the runtime drops the pipeline return value will be :keechma.pipelines.runtime/cancelled
@mihaelkonjevic @tiborkr appreciate your advice if you have a spare minute