Fork me on GitHub

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

👍 1

Thanks for the assistance


@mihaelkonjevic @tiborkr appreciate your advice if you have a spare minute