use of com.tvd12.example.reactive.RxHomeController in project java-examples by tvd12.
the class ReactiveExample method main.
public static void main(String[] args) {
final EzyBeanContext beanContext = EzyBeanContext.builder().scan("com.tvd12.example.reactive").build();
final RxHomeController rxHomeController = (RxHomeController) beanContext.getBean(RxHomeController.class);
final HomeData rxHomeData = rxHomeController.getHomeData();
System.out.println("rxHomeData: " + rxHomeData);
}
use of com.tvd12.example.reactive.RxHomeController in project java-examples by tvd12.
the class PerformanceCompareTest method main.
public static void main(String[] args) {
final EzyBeanContext beanContext = EzyBeanContext.builder().scan("com.tvd12.example.reactive").build();
final HomeController sequenceHomeController = (HomeController) beanContext.getBean(HomeController.class);
final RxHomeController rxHomeController = (RxHomeController) beanContext.getBean(RxHomeController.class);
// warm up
sequenceHomeController.getHomeData();
rxHomeController.getHomeData();
long sequenceCallElapsedTime = Performance.create().loop(100000).test(sequenceHomeController::getHomeData).getTime();
long rxCallElapsedTime = Performance.create().loop(100000).test(rxHomeController::getHomeData).getTime();
System.out.printf("sequence call elapsed time: %d\nreactive call elapsed time: %d\n", sequenceCallElapsedTime, rxCallElapsedTime);
Reactive.destroy();
}
Aggregations