Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-9317

Async I/O API Example For Scala has Variable Name error

    XMLWordPrintableJSON

Details

    Description

      Async I/O API Scala Example has duplicated resultFuture variable with different data type.

       

      resultFuture: ResultFuture[(String, String)]

      val resultFuture: Future[String]

       

      this cause error on compile as variables have same naming.

       

      In order to example works properly we need to update variable names to be distinct,

       

      ```

      override def asyncInvoke(input: (String,String, String), resultFuture: ResultFuture[(String,String, String, String)]): Unit = {

      // issue the asynchronous request, receive a future for the result
      val resultFutureRequested: Future[String] = Future

      { // client2.query(str) client.getAccountReferenceId(token, input._1) }

      // set the callback to be executed once the request by the client is complete
      // the callback simply forwards the result to the result future
      resultFutureRequested.onSuccess {
      case result: String =>

      { resultFuture.complete(Iterable((input._1, input._2, input._3, result))) }

      }
      }

      ```

       

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              yazdanjs Yazdan Shirvany
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: