"Minimal Example" Question

14 views
Skip to first unread message

Kevin Meredith

unread,
Mar 17, 2016, 10:19:12 PM3/17/16
to spray.io User List
The Spray Docs present a "Minimal Example" under spray-routing:


When running this web service, my understanding is that a single actor will receive HTTP requests (in the form of Actor messages).

If 100 requests are sent concurrently to this /hello route, then, will 100 messages be sent to the single actor handling these requests?

If that's true, then will the actor handle each message sequentially, i.e.

1 -- 2 -- 3 -- 4 -- .. -- 100

where `--` indicates the amount of work to complete the request? 

Is there any concurrency involved to handle multiple message at once?

Kevin Meredith

unread,
Mar 17, 2016, 10:21:15 PM3/17/16
to spray.io User List
My mistake - I forgot to include the example:

import spray.routing.SimpleRoutingApp

object Main extends App with SimpleRoutingApp {
  implicit val system = ActorSystem("my-system")

  startServer(interface = "localhost", port = 8080) {
    path("hello") {
      get {
        complete {
          <h1>Say hello to spray</h1>
        }
      }
    }
  }
}
Reply all
Reply to author
Forward
0 new messages