Created
June 3, 2011 12:17
-
-
Save alextkachman/1006250 to your computer and use it in GitHub Desktop.
Type inference in Groovy++ sample
This file contains hidden or 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
@Typed class GridGainTest { | |
public static void main(String[] args) { | |
def local = GridFactory.start("spring-cache.xml").localNode | |
local.remoteListenAsync(local) { nid, String msg -> | |
// we infer of course that this is GridListenActor | |
grid () | |
// we infer nid instanceof UUID | |
println nid.leastSignificantBits | |
println msg | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
GridListenActor has other methods (respond(), stop()...). Can you call these methods from within the closure in your case?