Skip to content

Instantly share code, notes, and snippets.

@yatatsu
Created September 7, 2017 03:45
Show Gist options
  • Save yatatsu/4d9f60b0dea33a844f09e0fdeed76868 to your computer and use it in GitHub Desktop.
Save yatatsu/4d9f60b0dea33a844f09e0fdeed76868 to your computer and use it in GitHub Desktop.
package com.github.yatatsu.util;
public interface ScheduleUnit {
@NonNull Scheduler io();
@NonNull Scheduler ui();
final class AppUnit implements ScheduleUnit {
@NonNull public Scheduler io() {
return Schedulers.io();
}
@NonNull public Scheduler ui() {
return AndroidSchedulers.mainThread();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment