The sample code

*object Main extends App {*



*  implicit val system = ActorSystem("akka-http-core")*

*  implicit val materializer = ActorMaterializer()*


*  val uri = 
Uri("http://maps.googleapis.com/maps/api/elevation/json?locations=27.988056,86.925278";)*


*  Http().singleRequest(HttpRequest(uri = uri)) onComplete {*

*    case Success(res) => {*

*      res.entity.dataBytes.runFold("")((s, b) => s + b.utf8String) 
onComplete {*

*        case Success(s) => {*

*          println(s)*

          *system.shutdown()*

*        }*

*        case Failure(t) => {*

*          println(t)*

          *system.shutdown()*

*        }*

*      }*

*    }*

*    case Failure(bad) => {*

*      println(bad)*

      *system.shutdown()*

*    }*

*  }*

*}*

prints the response fine but consistently produces an error:

*{*
*   "results" : [*
*      {*
*         "elevation" : 8815.7158203125,*
*         "location" : {*
*            "lat" : 27.988056,*
*            "lng" : 86.92527800000001*
*         },*
*         "resolution" : 152.7032318115234*
*      }*
*   ],*
*   "status" : "OK"*
*}*

*[ERROR] [09/09/2015 13:27:43.956] 
[akka-http-core-akka.actor.default-dispatcher-11] 
[ActorSystem(akka-http-core)] Outgoing request stream error 
(akka.stream.AbruptTerminationException)*
*[success] Total time: 5 s, completed Sep 9, 2015 1:27:43 PM*

When is the right time to call ActorSystem.shutdown() in order to terminate 
without errors?

TIA,
Matthew

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to