Skip to content

Commit

Permalink
Fixes issue ReactiveX#158
Browse files Browse the repository at this point in the history
Accept Subject instead of PublishSubject
  • Loading branch information
Nitesh Kant committed Jun 30, 2014
1 parent d35a8dd commit f590cf4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.reactivex.netty.protocol.http.client;

import io.netty.handler.codec.http.Cookie;
Expand All @@ -23,7 +24,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import rx.Observable;
import rx.subjects.PublishSubject;
import rx.subjects.Subject;

import java.util.Map;
import java.util.Set;
Expand All @@ -47,13 +48,13 @@ public class HttpClientResponse<T> {
public static final String KEEP_ALIVE_TIMEOUT_HEADER_ATTR = "timeout";

private final HttpResponse nettyResponse;
private final PublishSubject<T> contentSubject;
private final Subject<T, T> contentSubject;
private final HttpResponseHeaders responseHeaders;
private final HttpVersion httpVersion;
private final HttpResponseStatus status;
private final CookiesHolder cookiesHolder;

public HttpClientResponse(HttpResponse nettyResponse, PublishSubject<T> contentSubject) {
public HttpClientResponse(HttpResponse nettyResponse, Subject<T, T> contentSubject) {
this.nettyResponse = nettyResponse;
this.contentSubject = contentSubject;
httpVersion = this.nettyResponse.getProtocolVersion();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.reactivex.netty.protocol.http.server;

import io.netty.handler.codec.http.Cookie;
Expand All @@ -21,7 +22,7 @@
import io.netty.handler.codec.http.HttpVersion;
import io.reactivex.netty.protocol.http.CookiesHolder;
import rx.Observable;
import rx.subjects.PublishSubject;
import rx.subjects.Subject;

import java.util.List;
import java.util.Map;
Expand All @@ -34,13 +35,13 @@ public class HttpServerRequest<T> {

private final HttpRequest nettyRequest;
private final HttpRequestHeaders headers;
private final PublishSubject<T> contentSubject;
private final Subject<T, T> contentSubject;
private final HttpMethod method;
private final HttpVersion protocolVersion;
private final UriInfoHolder uriInfoHolder;
private final CookiesHolder cookiesHolder;

public HttpServerRequest(HttpRequest nettyRequest, PublishSubject<T> contentSubject) {
public HttpServerRequest(HttpRequest nettyRequest, Subject<T, T> contentSubject) {
this.nettyRequest = nettyRequest;
headers = new HttpRequestHeaders(this.nettyRequest);
method = this.nettyRequest.getMethod();
Expand Down

0 comments on commit f590cf4

Please sign in to comment.