Skip to content

Instantly share code, notes, and snippets.

@jkutner
Created February 27, 2011 23:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkutner/846707 to your computer and use it in GitHub Desktop.
Save jkutner/846707 to your computer and use it in GitHub Desktop.
simple example of Akka STM in Java
new Atomic<Void>() {
public Void atomically() {
ref.set(refs.get() + 1);
return null;
}
}.execute();
Class.new(Atomic) do
def init(ref)
@ref = ref
self
end
def atomically
@ref.set(@ref.get + 1)
end
end.new.init(ref).execute
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment