Skip to content

Instantly share code, notes, and snippets.

@RoryKelly
RoryKelly / MirroredSource.java
Last active February 7, 2018 07:58
Mirrored Source for OKIO.
/**
* Takes a bytes source and streams it to parallel sources. I.E Streaming bytes to two server in parallel.
*/
public final class MirroredSource {
private final Buffer buffer = new Buffer();
private final Source source;
private final AtomicBoolean sourceExhausted = new AtomicBoolean();
private boolean closed = false;
@lukaspili
lukaspili / LoginScreen.java
Last active August 29, 2015 14:16
Dagger 2 / Mortar / Flow
@Layout(R.layout.view_login)
@WithComponent(LoginScreen.Component.class)
public class LoginScreen extends Path {
@dagger.Component(dependencies = RootActivity.Component.class)
@PerScreenScope(Component.class)
public static interface Component extends RootActivity.Component {
void inject(LoginView view);
}