org.saynotobugs.confidence.rxjava3.adapters.EmitterAdapter Maven / Gradle / Ivy
The newest version!
package org.saynotobugs.confidence.rxjava3.adapters;
import io.reactivex.rxjava3.core.Emitter;
import org.saynotobugs.confidence.rxjava3.RxSubjectAdapter;
public final class EmitterAdapter implements RxSubjectAdapter
{
private final Emitter mEmitter;
public EmitterAdapter(Emitter emitter)
{
mEmitter = emitter;
}
@Override
public void onNext(T next)
{
mEmitter.onNext(next);
}
@Override
public void onComplete()
{
mEmitter.onComplete();
}
@Override
public void onError(Throwable error)
{
mEmitter.onError(error);
}
@Override
public boolean hasSubscribers()
{
return false; // we don't really know
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy