Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Decouple HttpClientRequest/HttpClientResponse from http 1.1
- Loading branch information
Showing
8 changed files
with
280 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/main/java/io/vertx/core/http/impl/Http2ConnectionManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,34 @@ | |||
/* | |||
* Copyright (c) 2011-2013 The original author or authors | |||
* ------------------------------------------------------ | |||
* All rights reserved. This program and the accompanying materials | |||
* are made available under the terms of the Eclipse Public License v1.0 | |||
* and Apache License v2.0 which accompanies this distribution. | |||
* | |||
* The Eclipse Public License is available at | |||
* http://www.eclipse.org/legal/epl-v10.html | |||
* | |||
* The Apache License v2.0 is available at | |||
* http://www.opensource.org/licenses/apache2.0.php | |||
* | |||
* You may elect to redistribute this code under either of these licenses. | |||
*/ | |||
|
|||
package io.vertx.core.http.impl; | |||
|
|||
import io.vertx.core.Handler; | |||
import io.vertx.core.impl.ContextImpl; | |||
|
|||
import java.util.function.BooleanSupplier; | |||
|
|||
/** | |||
* @author <a href="mailto:julien@julienviet.com">Julien Viet</a> | |||
*/ | |||
public class Http2ConnectionManager { | |||
|
|||
public void getConnection(int port, String host, Handler<ClientConnection> handler, Handler<Throwable> connectionExceptionHandler, | |||
ContextImpl context, BooleanSupplier canceled) { | |||
connectionExceptionHandler.handle(new UnsupportedOperationException()); | |||
} | |||
|
|||
} |
50 changes: 50 additions & 0 deletions
50
src/main/java/io/vertx/core/http/impl/HttpClientConnection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,50 @@ | |||
/* | |||
* Copyright (c) 2011-2013 The original author or authors | |||
* ------------------------------------------------------ | |||
* All rights reserved. This program and the accompanying materials | |||
* are made available under the terms of the Eclipse Public License v1.0 | |||
* and Apache License v2.0 which accompanies this distribution. | |||
* | |||
* The Eclipse Public License is available at | |||
* http://www.eclipse.org/legal/epl-v10.html | |||
* | |||
* The Apache License v2.0 is available at | |||
* http://www.opensource.org/licenses/apache2.0.php | |||
* | |||
* You may elect to redistribute this code under either of these licenses. | |||
*/ | |||
|
|||
package io.vertx.core.http.impl; | |||
|
|||
import io.netty.buffer.ByteBuf; | |||
import io.netty.channel.ChannelFuture; | |||
import io.vertx.core.Context; | |||
import io.vertx.core.MultiMap; | |||
import io.vertx.core.http.HttpMethod; | |||
import io.vertx.core.http.HttpVersion; | |||
import io.vertx.core.net.NetSocket; | |||
|
|||
/** | |||
* @author <a href="mailto:julien@julienviet.com">Julien Viet</a> | |||
*/ | |||
interface HttpClientConnection { | |||
|
|||
void writeHead(HttpVersion version, HttpMethod method, String uri, MultiMap headers, boolean chunked); | |||
void writeHeadWithContent(HttpVersion vertsion, HttpMethod method, String uri, MultiMap headers, boolean chunked, ByteBuf buf, boolean end); | |||
void writeBuffer(ByteBuf buf, boolean end); | |||
String hostHeader(); | |||
Context getContext(); | |||
void doSetWriteQueueMaxSize(int size); | |||
boolean isNotWritable(); | |||
void handleInterestedOpsChanged(); | |||
void endRequest(); | |||
|
|||
void doPause(); | |||
void doResume(); | |||
|
|||
// Try to remove that ? | |||
void reportBytesWritten(long numberOfBytes); | |||
void reportBytesRead(long s); | |||
|
|||
NetSocket createNetSocket(); | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.