puniverse / comsat

Fibers and actors for web development
docs.paralleluniverse.co/comsat
Other
598 stars 103 forks source link

comsat-httpclient does not expose the client as a FiberHttpClient #39

Closed azell closed 9 years ago

azell commented 9 years ago
public CloseableHttpClient build() {
        final FiberHttpClient res =
            ioreactor != null ?
                new FiberHttpClient(builder.build(), ioreactor) :
                new FiberHttpClient(builder.build());
        return res;
    }

I would like to pass an instance of FiberHttpClient to FiberRestAdapterBuilder:

    public RestAdapter.Builder setClient(FiberHttpClient client) {
        this.httpClient = client;
        return this;
    }

Because the builder returns an instance of CloseableHttpClient, I have to typecast it to FiberHttpClient. Ex:

CloseableHttpClient client  = builder.build();
...
serClient((FiberHttpClient) client)
...