Skip to content

Instantly share code, notes, and snippets.

@jhalterman
jhalterman / minscalaactors.scala
Created November 15, 2017 03:27 — forked from viktorklang/minscalaactors.scala
Minimalist Scala Actors
/*
Copyright 2012 Viktor Klang
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
(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
: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