First pass on separating stm into its own module
- removed transactors everywhere - moved stm into akka-stm module - disabled agents (they use transactors internally) - rewrote persistence tests so that they don't use transactors
This commit is contained in:
parent
73c0f31779
commit
9012847ff1
84 changed files with 404 additions and 1495 deletions
|
|
@ -1,26 +0,0 @@
|
|||
package akka.stm;
|
||||
|
||||
import akka.stm.Ref;
|
||||
import akka.stm.local.Atomic;
|
||||
|
||||
public class CounterExample {
|
||||
final static Ref<Integer> ref = new Ref<Integer>(0);
|
||||
|
||||
public static int counter() {
|
||||
return new Atomic<Integer>() {
|
||||
public Integer atomically() {
|
||||
int inc = ref.get() + 1;
|
||||
ref.set(inc);
|
||||
return inc;
|
||||
}
|
||||
}.execute();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println();
|
||||
System.out.println("Counter example");
|
||||
System.out.println();
|
||||
System.out.println("counter 1: " + counter());
|
||||
System.out.println("counter 2: " + counter());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue