Liking cljdoc? Tell your friends :D

org.clojars.roklenarcic.paginator

Paginator enables paginating multiple concurrent items with batching.

Paginator enables paginating multiple concurrent items with batching.
raw docstring

async-fnclj

(async-fn f max-concurrency)

Helper to wrap a function into one that executes async in 'future', with concurrency limited to concurrency. The returned fn has semaphone object in meta.

If you pass another fn created by this function as concurrency, the returned function will share the concurrency limit with the other one.

Helper to wrap a function into one that executes async in 'future',
with concurrency limited to concurrency. The returned fn has semaphone object in meta.

If you pass another fn created by this function as concurrency, the returned function will share
the concurrency limit with the other one.
sourceraw docstring

batcherclj

(batcher batch-size)
(batcher batch-size partial-batch-strategy)

Create batcher with parameters:

  • batch size
  • partial-batch-strategy (can be nil, :min-batches, or map of factors)
Create batcher with parameters:
- batch size
- partial-batch-strategy (can be nil, :min-batches, or map of factors)
sourceraw docstring

grouped-batcherclj

(grouped-batcher group-fn batch-size)
(grouped-batcher group-fn batch-size partial-batch-strategy)

Create a batcher that groups by provided function. Returns batches of size n from each group as it fills up. Group fn receives a PagingState, and it should return the group.

Partial batch strategy can be nil or :min-batches of a map of factors.

Create a batcher that groups by provided function. Returns batches of size n from
each group as it fills up. Group fn receives a PagingState, and it should return the group.

Partial batch strategy can be nil or :min-batches of a map of factors.
sourceraw docstring

paginate!clj

(paginate! run-fn
           {:keys [batcher pages? concurrency wrapped?] :as options}
           input)

Paginates a collection of items using run-fn.

Paginates a collection of items using run-fn.
sourceraw docstring

paginate-one!clj

(paginate-one! input run-fn)
(paginate-one! input run-fn {:keys [pages? wrapped?] :as options})

Paginates one item, using run-fn. Returns a sequence of maps, one for each item with merged properties from input into each.

  • input is a map, is converted to PagingState
  • run-fn can return a PagingState, a map (which will be converted to paging state) or Future or IPending
  • options: :paged?, if set to true the function returns a lazy sequence of PagingStates, one for each page as it gets loaded :wrapped?, if set to true, PagingState is returned instead of the unwrapped form of item sequence
Paginates one item, using run-fn. Returns a sequence of maps, one for each item with merged
properties from input into each.

- input is a map, is converted to PagingState
- run-fn can return a PagingState, a map (which will be converted to paging state) or Future or IPending
- options: :paged?, if set to true the function returns a lazy sequence of PagingStates, one for each
                    page as it gets loaded
           :wrapped?, if set to true, PagingState is returned instead of the unwrapped form of item sequence
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close