Skip to content

Instantly share code, notes, and snippets.

@jsanda
Created July 20, 2017 20:14
Show Gist options
  • Save jsanda/3d1807932194d759c21be9e2a3285103 to your computer and use it in GitHub Desktop.
Save jsanda/3d1807932194d759c21be9e2a3285103 to your computer and use it in GitHub Desktop.
// how we did async in the dark ages
Futures.addCallback(session.executeAsync(boundStatement), new FutureCallback<ResultSet>() {
@Override
public void onSuccess(ResultSet rows) {
rows.forEach(row -> mappings.put(row.getString(0), row.getString(1)));
}
@Override
public void onFailure(Throwable throwable) {
// handle failure
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment