Adds logic to archive the contents of log graphs on reset.
Adds logic to archive the contents of log graphs on reset.
(archive-path g)Returns a canonical name for an archive file for a log Where
glog:LogGraphReturns a canonical name for an archive file for a log Where - <g> is a log-graph, Typically `glog:LogGraph`
(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-graphnew-graph is the newly reset log-grapharchive-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.(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 millisecondsarticle := {: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!`.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 volumearticle := {::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.
(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
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://
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`
(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-grapharchive-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`.
(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-graphurl is the URL of a location where the previous contents of @gatom
have been archived.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.(wait-for _test ms)Returns: non-falsey result of test, or ::timeout after ms milliseconds.
Where
result is a truthy response from testtest := fn [] -> truthy valuems is max time to wait for test to be truthyReturns: 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
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |