mashupbots / socko

A Scala web server powered by Netty networking and AKKA processing.
Other
255 stars 51 forks source link

Guide error? #89

Closed cube-drone closed 10 years ago

cube-drone commented 10 years ago

In Step 1, example 1. of the guide, the following code won't compile, as the HttpRequestEvent object doesn't have a 'writeResponse' method. Perhaps this guide is for an earlier version of Socko?

class HelloHandler extends Actor {
    def receive = {
    case request: HttpRequestEvent =>
      request.writeResponse("Hello from Socko (" + new Date().toString + ")")
      context.stop(self)
  }
}
simbo1905 commented 10 years ago

Yes the quickstart example current on trunk and the newest tag gets the response from the event:

class HelloHandler extends Actor {
  def receive = {
    case event: HttpRequestEvent =>
      event.response.write("Hello from Socko (" + new Date().toString + ")")
      context.stop(self)
  }
}

https://github.com/mashupbots/socko/blob/socko-0.4.2/socko-examples/src/main/scala/org/mashupbots/socko/examples/quickstart/HelloHandler.scala

veebs commented 10 years ago

Thanks for that. I'll update the doco.

On 27 April 2014 17:32, simbo1905 notifications@github.com wrote:

Yes the quickstart example current on trunk and the newest tag gets the response from the event:

class HelloHandler extends Actor { def receive = { case event: HttpRequestEvent => event.response.write("Hello from Socko (" + new Date().toString + ")") context.stop(self) } }

https://github.com/mashupbots/socko/blob/socko-0.4.2/socko-examples/src/main/scala/org/mashupbots/socko/examples/quickstart/HelloHandler.scala

— Reply to this email directly or view it on GitHubhttps://github.com/mashupbots/socko/issues/89#issuecomment-41490297 .