Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix compile errors in README.md examples #109

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 10 additions & 9 deletions README.md
Expand Up @@ -83,8 +83,8 @@ The following server, which is shown in both Scala and Java, responds to a clien

val address: SocketAddress = new InetSocketAddress(10000) // 3

val server: Server[HttpRequest, HttpResponse] = ServerBuilder() // 4
.codec(Http)
val server: Server = ServerBuilder() // 4
.codec(Http())
.bindTo(address)
.name("HttpServer")
.build(service)
Expand All @@ -99,7 +99,7 @@ The following server, which is shown in both Scala and Java, responds to a clien
};

ServerBuilder.safeBuild(service, ServerBuilder.get() // 4
.codec(Http.get())
.codec(Http())
.name("HttpServer")
.bindTo(new InetSocketAddress("localhost", 10000))); // 3

Expand Down Expand Up @@ -128,7 +128,7 @@ The client, which is shown in both Scala and Java, connects to the server, and i
##### Scala HTTP Client Implementation

val client: Service[HttpRequest, HttpResponse] = ClientBuilder() // 1
.codec(Http)
.codec(Http())
.hosts(address)
.hostConnectionLimit(1)
.build()
Expand All @@ -142,7 +142,7 @@ The client, which is shown in both Scala and Java, connects to the server, and i
##### Java HTTP Client Implementation

Service<HttpRequest, HttpResponse> client = ClientBuilder.safeBuild(ClientBuilder.get() // 1
.codec(Http.get())
.codec(Http())
.hosts("localhost:10000")
.hostConnectionLimit(1));

Expand Down Expand Up @@ -1035,7 +1035,8 @@ The following example encapsulates the filters and service in the previous examp
= handleExceptions andThen authorize andThen respond

val server: Server = ServerBuilder()
.codec(Http)
.name("myService")
.codec(Http())
.bindTo(new InetSocketAddress(8080))
.build(myService)
}
Expand All @@ -1052,7 +1053,7 @@ In this example, the `HandleExceptions` filter is executed before the `authorize
A robust client has little to do with the lines of code (SLOC) that goes into it; rather, the robustness depends on how you configure the client and the testing you put into it. Consider the following HTTP client:

val client = ClientBuilder()
.codec(Http)
.codec(Http())
.hosts("localhost:10000,localhost:10001,localhost:10003")
.hostConnectionLimit(1) // max number of connections at a time to a host
.connectionTimeout(1.second) // max time to spend establishing a TCP connection
Expand Down Expand Up @@ -1318,7 +1319,7 @@ The following example shows the instantiation and invocation of the server. Call
public static void main(String[] args) {
ServerBuilder.safeBuild(new HTTPServer(),
ServerBuilder.get()
.codec(Http.get())
.codec(Http())
.name("HTTPServer")
.bindTo(new InetSocketAddress("localhost", 8080)));

Expand Down Expand Up @@ -1380,7 +1381,7 @@ The following example shows the instantiation and invocation of a client. Callin
Service<HttpRequest, HttpResponse> httpClient =
ClientBuilder.safeBuild(
ClientBuilder.get()
.codec(Http.get())
.codec(Http())
.hosts(new InetSocketAddress(8080))
.hostConnectionLimit(1));

Expand Down