Java Code Examples for io.reactivex.schedulers.Schedulers.single()

The following are Jave code examples for showing how to use single() of the io.reactivex.schedulers.Schedulers class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: Spring-5.0-Cookbook   File: EmployeeRxJavaServiceImpl.java   Source Code and License Vote up 5 votes
@Override
public Flowable<String> getEmpNamesRx() {
	Scheduler observerWorker = Schedulers.single();
	Scheduler subscriberWorker = Schedulers.newThread();
	Function<Employee, String> names = (emp) -> emp.getFirstName() + emp.getLastName();
	Flowable<String> emps = Flowable.fromIterable(employeeDaoImpl.getEmployees())
			.map(names).observeOn(observerWorker).subscribeOn(subscriberWorker);
	return emps;
}
 
Example 2
Project: rxstate   File: RxStateTest.java   Source Code and License Vote up 5 votes
@Test
public void simplePrint() throws Exception {
    RxState<Integer> state = new RxState<>(0, Schedulers.single());
    state.values(StartWith.SCHEDULE)
            .subscribe(it -> System.out.println(it));
    state.apply(it -> it + 1);
}
 
Example 3
Project: Reactive-Android-Programming   File: Sandbox.java   Source Code and License Vote up 5 votes
private void demo0() {
    Schedulers.single();
    Schedulers.trampoline();
    Schedulers.newThread();
    Schedulers.computation();
    Schedulers.io();
    Schedulers.io();
}
 
Example 4
Project: Reactive-Android-Programming   File: Sandbox.java   Source Code and License Vote up 5 votes
private void demo0() {
    Schedulers.single();
    Schedulers.trampoline();
    Schedulers.newThread();
    Schedulers.computation();
    Schedulers.io();
    Schedulers.io();
}
 
Example 5
Project: sample-code-posts   File: GeneralTestHelper.java   Source Code and License Vote up 4 votes
private RxSchedulers getTestRxSchedulers() {
    return new RxSchedulers(Schedulers.single(), Schedulers.single(), Schedulers.single(),
            Schedulers.single());
}