(revision-applied? obj rev)
Tell whether the revision named by rev has already been written.
Tell whether the revision named by rev has already been written.
(call-wrapped objects f)
Calls [f] inside a transaction on all the [objects]. Attempts to minimize stack depth by using Transactional when possible, but will use WrappedTransactional as necessary.
Calls [f] inside a transaction on all the [objects]. Attempts to minimize stack depth by using Transactional when possible, but will use WrappedTransactional as necessary.
(compose & io-values)
Create a single combined IOValue out of multiple IOValues, by performing the IO actions in order and returning the value of the right-most IOValue.
Create a single combined IOValue out of multiple IOValues, by performing the IO actions in order and returning the value of the right-most IOValue.
(dotxn foci & body)
Open a transaction around each focus object, then evaluate body, then close the transactions.
Open a transaction around each focus object, then evaluate body, then close the transactions.
(modify! obj)
Alert retro that an operation is about to occur which will modify the given object. If there is an active transaction which is not expected to modify the object, retro will throw an exception. Should be used similarly to clojure.core/io!.
Alert retro that an operation is about to occur which will modify the given object. If there is an active transaction which is not expected to modify the object, retro will throw an exception. Should be used similarly to clojure.core/io!.
(revision-range obj)
Return a seq of revisions that describe the object's timestream. These represent plausible answers to the "vague" question of "what is the highest revision of this object that exists?".
Note that when no transactions are in progress, this should return a one-element list; however, when a transaction is uncommitted, it is possible for there to be multiple reasonable answers. Should be unaffected by at-revision 'views'.
nil is an acceptable answer, meaning "I'm not tracking that".
Return a seq of revisions that describe the object's timestream. These represent plausible answers to the "vague" question of "what is the highest revision of this object that exists?". Note that when no transactions are in progress, this should return a one-element list; however, when a transaction is uncommitted, it is possible for there to be multiple reasonable answers. Should be unaffected by at-revision 'views'. nil is an acceptable answer, meaning "I'm not tracking that".
(touch obj)
Mark the current revision as being applied, guaranteeing that max-revision returns a number at least as large as the object's current revision.
Mark the current revision as being applied, guaranteeing that max-revision returns a number at least as large as the object's current revision.
(at-revision obj rev)
Return a copy of obj with the current revision set to rev.
Return a copy of obj with the current revision set to rev.
(current-revision obj)
Return the current revision.
Return the current revision.
(txn-begin! obj)
Begin a new transaction.
Begin a new transaction.
(txn-commit! obj)
Commit the current transaction.
Commit the current transaction.
(txn-rollback! obj)
Roll back the current transaction.
Roll back the current transaction.
(txn actions)
Sugar around txn*: actions is now a single form (with NO implicit do), rather than a thunk.
Sugar around txn*: actions is now a single form (with NO implicit do), rather than a thunk.
(txn* action-thunk)
(txn* action-thunk revision-bump)
Perform a transaction across multiple Retro objects. The [action-thunk] will be evaluated in read-only mode, and should return an IOValue object, whose :actions should be a map from focus objects - on which transactions will be opened - to a sequence of functions.
For each focus object, a transaction will be opened at the next revision (or you can pass a [revision-bump] other than inc to adjust how the write-revision is computer), and the "action" functions will each be called, in order, with the in-transaction object as an argument. Once each action has been applied, the transaction will be closed, and the next focus object's actions begin.
The eventual return value of txn* is the :value of the IOValue computed.
Perform a transaction across multiple Retro objects. The [action-thunk] will be evaluated in read-only mode, and should return an IOValue object, whose :actions should be a map from focus objects - on which transactions will be opened - to a sequence of functions. For each focus object, a transaction will be opened at the *next* revision (or you can pass a [revision-bump] other than inc to adjust how the write-revision is computer), and the "action" functions will each be called, in order, with the in-transaction object as an argument. Once each action has been applied, the transaction will be closed, and the next focus object's actions begin. The eventual return value of txn* is the :value of the IOValue computed.
(unsafe-txn actions)
Apply an action-map similarly to txn, but without bumping the revision of the target object; this is unsafe in terms of recovering from crashes, and should only be used to simulate an older version of retro or for mutation-oriented code.
Apply an action-map similarly to txn, but without bumping the revision of the target object; this is unsafe in terms of recovering from crashes, and should only be used to simulate an older version of retro or for mutation-oriented code.
(update-revision obj f)
(update-revision obj f & args)
If the object has a revision, update it by calling f; otherwise leave it nil.
If the object has a revision, update it by calling f; otherwise leave it nil.
(wrap-touching obj f)
Wrap a function so that the active object is touched at the end.
Wrap a function so that the active object is touched at the end.
(wrap-transaction obj f)
Takes a function and returns a new function wrapped in a transaction on the given object.
Takes a function and returns a new function wrapped in a transaction on the given object.
(txn-wrap obj f)
Wrap the given thunk in a transaction, returning a new thunk.
Wrap the given thunk in a transaction, returning a new thunk.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close