Skip to content

Commit

Permalink
all done! 🥳 🚀 🎉
Browse files Browse the repository at this point in the history
  • Loading branch information
spamegg1 committed Sep 12, 2024
1 parent 8e27339 commit 3359875
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/scala/ch10/server.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import stdlib.malloc, string.{strncpy, strlen}
import collection.mutable
import concurrent.{Future, ExecutionContext}

case class Request[T](
case class Request[T]( // different than earlier chapters, type parameter T
method: String,
url: String,
headers: Map[String, String],
Expand Down Expand Up @@ -39,7 +39,7 @@ case class AsyncRoute(
object Server extends Parsing:
import ch07.LibUVConstants.*, ch07.LibUV.*, HttpParser.*

given ec: ExecutionContext = EventLoop
given ec: ExecutionContext = EventLoop // this is ch10's EventLoop, different
val loop = EventLoop.loop
var serial = 1L
override val requests = mutable.Map[Long, RequestState]()
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/ch10/service.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def libuvService: Unit =
.get("/"): r =>
OK(Map("message" -> s"got (routed) request $r"))
.run(9999)
uv_run(EventLoop.loop, UV_RUN_DEFAULT)
uv_run(EventLoop.loop, UV_RUN_DEFAULT) // ch10's EventLoop, different than earlier chps.
println("done")

object ServiceHelpers:
Expand Down

0 comments on commit 3359875

Please sign in to comment.