This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn try-until-success | |
"Accepts a try-fn to try a failure-fn to call upon failure, supplying the failure/exception. The try-fn is retried | |
until no failure is thrown." | |
[try-fn failure-fn] | |
(loop [] | |
(if-let [result (try | |
(try-fn) | |
(catch Exception e | |
(failure-fn e) | |
nil))] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(deftest create-cas-test | |
(let [test (run! | |
(assoc | |
noop-test | |
:name "foundationdb" | |
:os ubuntu/os | |
:db db | |
:client (cas-register) | |
:model (model/cas-register) | |
:checker (checker/compose {:html timeline/html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:cas (timeout 5000 (assoc op :type :info :value :timed-out) | |
(let [cas (reify Function | |
(apply [this, tr] | |
(let [ | |
[value value'] (:value op) | |
key_var (byte-array (map byte key)) | |
old_value (.getLong (Tuple/fromBytes (.get (.get tr (byte-array (map byte key))))) 0) | |
new_value (.pack (Tuple/from (into-array [value'])))] | |
(if (= old_value value) | |
(do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage setjdk 1.8 | |
function setjdk() { | |
if [ $# -ne 0 ]; then | |
removeFromPath '/System/Library/Frameworks/JavaVM.framework/Home/bin' | |
if [ -n "${JAVA_HOME+x}" ]; then | |
removeFromPath $JAVA_HOME | |
fi | |
export JAVA_HOME=`/usr/libexec/java_home -v $@` | |
export PATH=$JAVA_HOME/bin:$PATH | |
fi |
NewerOlder