Words Demo

This is a demo of bck2brwsr VM running RxJava. The main function that splits the message into six words is now written as:

    @ComputedProperty static java.util.List<String> words(String message) {
        Observable<List<String>> observable = StringObservable.split(Observable.just(message), " ").
            mergeWith(Observable.just("!").repeat()).
            take(6).toList();
        return observable.toBlocking().first();
    }

The fact that this works in Bck2Brwsr VM is another indication how complete and flexible the Bck2Brwsr virtual machine is.

Moreover there is an enormous amount of synergy between RxJava and Bck2Brwsr VM: Simulating threads inside of a browser is not trivial thing (in terms of performance). It is Bck2Brwsr's hope that the more people use the reactive coding style offered by RxJava the more portable their applications become (even when brought into the restricted execution environment of Bck2Brwsr).

All that is needed is to accept my bugfix into the official RxJava code base (done in 1.0.6 version) and possibly consider incorporating my other enhancement too. Then we can have RxJava running in a browser as well as in its classical environment...