Created
February 11, 2014 13:38
-
-
Save daschl/8934949 to your computer and use it in GitHub Desktop.
Much nicer
This file contains 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
addNode().mapMany(new Function<Boolean, Composable<Boolean>>() { | |
@Override | |
public Composable<Boolean> apply(Boolean success) { | |
return addService(); | |
} | |
}).mapMany(new Function<Boolean, Composable<String>>() { | |
@Override | |
public Composable<String> apply(Boolean success) { | |
return loadRawConfig(); | |
} | |
}).consume(new Consumer<String>() { | |
@Override | |
public void accept(String s) { | |
deferred.accept(s); | |
} | |
}); | |
addNode().consume(new Consumer<Boolean>() { | |
@Override | |
public void accept(Boolean success) { | |
if (success) { | |
addService().consume(new Consumer<Boolean>() { | |
@Override | |
public void accept(Boolean success) { | |
if (success) { | |
loadRawConfig().onComplete(new Consumer<Promise<String>>() { | |
@Override | |
public void accept(Promise<String> stringPromise) { | |
deferred.accept(stringPromise.get()); | |
} | |
}); | |
} | |
} | |
}); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment