Liking cljdoc? Tell your friends :D

ont-app.graph-log.archiving

Adds logic to archive the contents of log graphs on reset.

Adds logic to archive the contents of log graphs on reset.
raw docstring

archive-pathclj

(archive-path g)

Returns a canonical name for an archive file for a log Where

  • <g> is a log-graph, Typically glog:LogGraph
Returns a canonical name for an archive file for a log
Where
- <g> is a log-graph, Typically `glog:LogGraph`
sourceraw docstring

archive-to-fileclj

(archive-to-file article)

Side-effects: writes contents from article to archive-file and posts catalog-card to file-archived>>set-continuing-from. Where

  • contents is old-graph minus new-graph, and anything that would choke a reader, rendered in EDN.
  • article := {::topic ::LogReset ::old-graph ... ::new-graph ... }
  • catalog-card := {::topic ::catalog ::volume archive-file, ...}, merged with article.
  • old-graph is the previous contents of a log-graph
  • new-graph is the newly reset log-graph
  • archive-file is the path to a the contents written to disk.
Side-effects: writes `contents` from `article` to `archive-file` and posts `catalog-card` to `file-archived>>set-continuing-from`.
Where
- `contents` is `old-graph` minus `new-graph`, and anything that would choke a 
 reader, rendered in EDN.
- `article` := {::topic  ::LogReset
                ::`old-graph` ... 
                ::`new-graph` ...
                }
- `catalog-card` := {::topic ::catalog
                     ::volume `archive-file`,
                     ...}, merged with `article`.
- `old-graph` is the previous contents of a log-graph
- `new-graph` is the newly reset log-graph
- `archive-file` is the path to a the `contents` written to disk.
sourceraw docstring

check-archivingclj

(check-archiving)
(check-archiving ms)
(check-archiving gatom ms)

Side-effect: sets the :glog/continuingFrom relation in gatom Where

  • gatom is an atom containing an IGraph, (default log-graph), it must be configured so as to enable archiving.
  • ms is a timeout in milliseconds
  • article := {:glog/continuingFrom url, ...}
  • url is typically the URL of the contents of the previous gatom, before the most recent call to log-reset!.
Side-effect: sets the :glog/continuingFrom relation in `gatom`
Where
- `gatom` is an atom containing an IGraph, (default `log-graph`),
  it must be configured so as to enable archiving.
- `ms` is a timeout in milliseconds
- `article` := {:glog/continuingFrom `url`, ...}
- `url` is typically the URL of the contents of the previous `gatom`,
  before the most recent call to `log-reset!`.
sourceraw docstring

check-archiving-timeoutclj

source

def-listenercljmacro

(def-listener channel handler)
source

file-archived>>set-continuing-fromclj

A channel which will call set-continuing-from on each article Where

  • set-continuing-from := fn [article] -> ? with side-effect of setting (@glog/log-graph :glog/LogGraph :glog/continuingFrom) to volume
  • article := {::volume ..., ...}
  • volume is the file holding an edn representation of the previous incarnation of @glog/log-graph.
A channel which will call `set-continuing-from` on each `article`
Where
- `set-continuing-from` := fn [article] -> ? with side-effect of setting
  (@glog/log-graph :glog/LogGraph  :glog/continuingFrom) to `volume`
- `article` := {::volume ..., ...}
- `volume` is the file holding an edn representation of the previous
  incarnation of @glog/log-graph.
sourceraw docstring

log-reset!clj

(log-reset!)
(log-reset! new-graph)

Side-effect: resets @log-graph to initial-graph Side-effect: if (initial-graph:glog/SaveToFn igraph/compiledAs <path-fn>), the previous contents of the graph will be spit'd to <output-path> Where

  • <initial-graph> is an IGraph, informed by ont-app.graph-log.core/ontology
  • <fn> := fn [g] -> <output-path>
  • <output-path> is a valid path specification , possibly starting with file://
Side-effect: resets @log-graph to `initial-graph`
Side-effect: if (initial-graph:glog/SaveToFn igraph/compiledAs <path-fn>),
  the previous contents of the graph will be spit'd to <output-path>
Where
- <initial-graph> is an IGraph, informed by ont-app.graph-log.core/ontology
- <fn> := fn [g] -> <output-path>
- <output-path> is a valid path specification , possibly starting with file://
sourceraw docstring

log-reset>>archive-to-fileclj

A channel which will call archive-to-file on each article Where archive-to-file := fn [article] -> ? with side-effect of archving old-graph article := {:old-graph ..., :new-graph ..., ...} old-graph is the old log-graph being reset to new-graph

A channel which will call `archive-to-file` on each `article`
Where
`archive-to-file` := fn [article] -> ? with side-effect of archving `old-graph`
`article` :=  {:old-graph ..., :new-graph ..., ...}
`old-graph` is the old log-graph being reset to `new-graph`
sourceraw docstring

save-to-archiveclj

(save-to-archive archive-path g)

Side-effect: Writes contents of g to archive-path, after removing stuff that would choke a reader. Returns archive-path for g Where:

  • g is a graph derived from a log-graph
  • archive-path is a path to which the contents of g are written, generated by (archive-path-fn g)
  • archive-path-fn is a compiled function asserted with :glog/archivePathFn, or the default function glog/archive-path.
Side-effect: Writes contents of `g` to `archive-path`, after removing stuff that would choke a reader.
Returns `archive-path` for `g`
Where:
- `g` is a graph derived from a log-graph
- `archive-path` is a path to which the contents of `g` are written, generated 
  by (`archive-path-fn` `g`)
- `archive-path-fn` is a compiled function asserted with `:glog/archivePathFn`, 
   or the default function `glog/archive-path`.
sourceraw docstring

set-continuing-fromclj

(set-continuing-from catalog-card)

Side-effect: establishes :glog/coninuingFrom value per catalog-card in gatom Where

  • catalog-card := {::volume url, ...}
  • gatom (optional) an atom containing an IGraph. Default is log-graph
  • url is the URL of a location where the previous contents of @gatom have been archived.
  • Note: may throw error of type ::UnexpectedArchivingResult.
Side-effect: establishes :glog/coninuingFrom value per `catalog-card` in `gatom`
Where
  - `catalog-card` := {::volume `url`, ...}
  - `gatom` (optional) an atom containing an IGraph. Default is log-graph
  - `url` is the URL of a location where the previous contents of @gatom
     have been archived. 
  - Note: may throw error of type ::UnexpectedArchivingResult.
sourceraw docstring

theclj

source

wait-forclj

(wait-for _test ms)

Returns: non-falsey result of test, or ::timeout after ms milliseconds. Where

  • result is a truthy response from test
  • test := fn [] -> truthy value
  • ms is max time to wait for test to be truthy
Returns: non-falsey `result` of `test`, or ::timeout after `ms` milliseconds. 
Where
- `result` is a truthy response from `test`
- `test` := fn [] -> truthy value
- `ms` is max time to wait for `test` to be truthy
sourceraw docstring

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

× close