Azure / azure-cosmosdb-java

Java Async SDK for SQL API of Azure Cosmos DB
MIT License
54 stars 61 forks source link

Porting V3 OM changes from VSTS to Github #98

Closed srinathnarayanan closed 5 years ago

srinathnarayanan commented 5 years ago

Porting the V3 OM Branch from internal repo to public repo.

These changes bring the new object model and Reactor (Flux/Mono) support to the SDK.

slechta commented 5 years ago

Hi, Could you please add description what the code does? It is a lot of new code (cca 4500 lines added) Thank you.

moderakh commented 5 years ago

I have some comments. I am adding them.

mp911de commented 5 years ago

You could reduce reactor-adapter and rxjava2-interop dependencies to just rxjava-reactive-streams by replacing e.g. RxJava2Adapter.flowableToFlux(RxJavaInterop.toV2Flowable(observable)) with Flux.from(RxReactiveStreams.toPublisher(observable)).

This isn't terribly much yet it allows for dependency streamlining. Also, having the mentioned two adapter calls for common scenarios in a utility class living in your code base optimizes for readability.

Calling adapters around reactive types breaks the fluent API style, so applying transformations on Observable via observable.to(TypeAdapters::flux) helps retaining readability and the adapter would look like:

    public static <T> Flux<T> flux(Observable<T> observable) {
        return Flux.from(RxReactiveStreams.toPublisher(observable));
    }