Created
March 11, 2013 16:57
-
-
Save purplefox/5135685 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Clearly this won't actually work since obs2 would need to be final but then you can't assign it inside the handler | |
MyEventBus eb = new MyEventBus(); | |
Observable obs1 = eb.send("foo", "msg1"); | |
Observable obs2; | |
obs1.subscribe(new Action1<String>() { | |
@Override | |
public void call(String str) { | |
System.out.println("Got result: " + str); | |
obs2 = eb.send("foo", str); | |
} | |
}); | |
obs2.subscribe(new Action1<String>() { | |
@Override | |
public void call(String str) { | |
System.out.println("Got result: " + str); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment