Netflix/RxJava — pull request #1014 by benjchristensen (2014-04-03 06:09:18+00:00)
Title: Scheduler with Recurse/Inner

API changes as per https://github.com/Netflix/RxJava/issues/997

Usage looks like this:

```java
import java.util.concurrent.TimeUnit;

import rx.Scheduler.Inner;
import rx.Scheduler.Recurse;
import rx.functions.Action1;
import rx.schedulers.Schedulers;

public class Test {

public static void main(String args[]) {

Schedulers.newThread().schedule(new Action1() {

@Override
public void call(Recurse inner) {
System.out.println("do stuff");
// recurse
inner.schedule(this);
}

});

Schedulers.newThread().schedule(recurse -> {
System.out.println("do stuff");
recurse.schedule();
});

Schedulers.newThread().schedule(recurse -> {
System.out.println("do stuff");
recurse.schedule(1000, TimeUnit.MILLISECONDS);
});

Schedulers.newThread().schedule(recurse -> {
recurse.schedule(re -> {
System.out.println("do more stuff");
});
});

Inner inner = Schedulers.newThread().createInner();
inner.schedule(re -> {
System.out.println("do stuff");
re.schedule(r -> {
System.out.println("do more stuff");
});
});

}
}
```

Code outline:

![screen shot 2014-04-02 at 11 08 31 pm](https://cloud.githubusercontent.com/assets/813492/2600101/6c680404-baf6-11e3-916e-c41a817bc328.png)