Skip to content

Instantly share code, notes, and snippets.

@fearofcode
Created October 9, 2012 19:53
Show Gist options
  • Save fearofcode/3861024 to your computer and use it in GitHub Desktop.
Save fearofcode/3861024 to your computer and use it in GitHub Desktop.
java client sdk issue
final CountDownLatch localLatch = latchOne();
final MultiThreadAsserter localAsserter = new MultiThreadAsserter();
StackMobObjectOnServer<UserOnServer> user = doLoginLogout(StackMob.OAuthVersion.Two, false);
List<HashMap<String, String>> chores = new ArrayList<HashMap<String, String>>();
HashMap<String, String> todo1 = new HashMap<String, String>();
todo1.put("action", "related object 1");
HashMap<String, String> todo2 = new HashMap<String, String>();
todo2.put("action", "related object 2");
chores.add(todo1);
chores.add(todo2);
user.getStackmob().getDatastore().postRelatedBulk("user", "ralphpootawn", "chores", chores, new StackMobCallback() {
@Override
public void success(String responseBody) {
localLatch.countDown();
}
@Override
public void failure(StackMobException e) {
localAsserter.markException(e);
}
});
localAsserter.assertLatchFinished(localLatch);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment