Closed phoebosys closed 7 years ago
Here is a related mail I've received:
I would like to notify you about your tutorial on Vert.x here http://escoffier.me/vertx-hol/#_task_coordinating_async_methods_and_consuming_http_endpoints_portfolio_value_evaluation that maybe there is a slight error. In this code snippet:
HttpEndpoint.getClient(discovery, new JsonObject().put("name", "quotes"), (1) client -> { if (client.failed()) { (2) // It failed... resultHandler.handle(Future.failedFuture(client.cause())); } else { // We have the client HttpClient httpClient = client.result(); (3) computeEvaluation(httpClient, resultHandler); } });
The compiler complains that the discovery field is not the type it supposed to be and offers me to cast it to like this:
HttpEndpoint.getClient((io.vertx.rxjava.servicediscovery.ServiceDiscovery) discovery, new JsonObject().put("name", "quotes"), ... });
or in other words, from type io.vertx.servicediscovery.ServiceDiscovery to type io.vertx.rxjava.servicediscovery.ServiceDiscovery.
So far, I am following the tutorial as described. Can you please look at it when you have time? To see if I am doing something wrong, or the tutorial at this point should be redacted.
Code in document use HttpClient, but project code has turn to WebClient.