Skip to content

Instantly share code, notes, and snippets.

@saturnism
Last active December 22, 2015 21:39
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 saturnism/6534698 to your computer and use it in GitHub Desktop.
Save saturnism/6534698 to your computer and use it in GitHub Desktop.
Java Lambda 8 with JDeferred!

Just played around w/ Java 8 Lambda expression with my JDeferred project.

dm.when(() -> {
  return "Hey!";
}).done(r -> System.out.println(r));

dm.when(
  () -> { return "Hello"; },
  () -> { return "World"; }
).done(rs ->
  rs.forEach(r -> System.out.println(r.getResult()))
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment