Liking cljdoc? Tell your friends :D

k16.mallard.log


find-unappliedclj

(find-unapplied oplog operations direction)

Return an ordered set of unapplied operations, calculated from the current oplog state and desired :direction.

  • If the direction is :up this will return the remaining set of unapplied operations.
  • If the direction is :down this will return the set of applied operations in reverse order.

When calculating operations in the :down direction, some entries may be returned as nil if no operation from the given set of operations could be found to match an entry in the oplog.

Return an ordered set of unapplied operations, calculated from the current
oplog state and desired `:direction`.

- If the direction is `:up` this will return the remaining set of _unapplied_
  operations.
- If the direction is `:down` this will return the set of _applied_
  operations in reverse order.

When calculating operations in the `:down` direction, some entries may be
returned as `nil` if no operation from the given set of `operations` could be
found to match an entry in the oplog.
sourceraw docstring

projectclj

(project oplog)

Reduces over the oplog to project the concrete sequence of currently applied operations.

The oplog contains a sequence of :up and :down operations which can be reduced down to a sequence of only :up operation ids

Example:

(project [{:id "1" :direction :up}
          {:id "1" :direction :down}
          {:id "2" :direction :up}
          {:id "3" :direction :up}])
;; => [{:id "2" ...} {:id "3" ...}]
Reduces over the `oplog` to project the concrete sequence of currently
applied operations.

The `oplog` contains a sequence of `:up` and `:down` operations which can be
reduced down to a sequence of only `:up` operation ids

Example:

```clojure
(project [{:id "1" :direction :up}
          {:id "1" :direction :down}
          {:id "2" :direction :up}
          {:id "3" :direction :up}])
;; => [{:id "2" ...} {:id "3" ...}]
```
sourceraw docstring

reconcile-operationsclj

(reconcile-operations oplog operations)

Determine the working state by reconciling the given set of operations against the current oplog.

Returns operations in two groups;

  • :applied - containing operations that have already been applied according to the log.
  • :unapplied - containing operations that have not yet been applied.

Operations in the :applied set may be ordered differently to how they are provided as the order they appear in oplog takes precedence.

Operations in the :applied section maybe also be nil in the event that the operation that was applied according to the oplog is no longer present or identifiable from the provided set of operations.

Determine the working state by reconciling the given set of `operations`
against the current `oplog`.

Returns operations in two groups;

- `:applied` - containing operations that have already been applied according
  to the log.
- `:unapplied` - containing operations that have not yet been applied.

Operations in the `:applied` set may be ordered differently to how they are
provided as the order they appear in `oplog` takes precedence.

Operations in the `:applied` section maybe also be `nil` in the event that
the operation that was applied according to the `oplog` is no longer present
or identifiable from the provided set of `operations`.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close