Created
July 15, 2015 13:27
-
-
Save jsanda/7f500b6932de3b9c636f 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
Observable<Lease> leases = queryLeases(timeSlice) | |
.flatMap(Observable::from) | |
.map(row -> new Lease(timeSlice.getTime(), row.getInt(1), row.getString(2), row.getBool(3))) | |
.filter(lease -> !lease.isFinished()) | |
.toList() | |
.repeat() | |
.takeUntil(List::isEmpty) | |
.flatMap(Observable::from); | |
// At this point I want to fetch the tasks for the lease, | |
// execute each task, then delete the tasks partition, | |
// and reschedule the tasks for subsequent execution | |
leases.subscribe( | |
System.out::println, | |
Throwable::printStackTrace, | |
() -> System.out.println("done!") | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment