Skip to content

Instantly share code, notes, and snippets.

@alextkachman
Created June 3, 2011 12:17
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 alextkachman/1006250 to your computer and use it in GitHub Desktop.
Save alextkachman/1006250 to your computer and use it in GitHub Desktop.
Type inference in Groovy++ sample
@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
}
}
}
@gridgain
Copy link

gridgain commented Jun 3, 2011

GridListenActor has other methods (respond(), stop()...). Can you call these methods from within the closure in your case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment