Skip to content

Commit

Permalink
Added unregister to Server to allow removal of Handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
darkfrog26 committed Oct 11, 2016
1 parent ec9bc20 commit 70f0c11
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/jvm/src/main/scala/org/hyperscala/Server.scala
Expand Up @@ -78,6 +78,10 @@ class Server(host: String, port: Int, sessionDomain: Option[String] = None, sess
register(handler)
}

def unregister(handler: Handler): Unit = synchronized {
handlers = handlers.filterNot(_ eq handler)
}

override def handleRequest(exchange: HttpServerExchange): Unit = {
exchange.putAttachment(SessionConfig.ATTACHMENT_KEY, sessionCookieConfig)
Server.withServerSession(Sessions.getOrCreateSession(exchange)) {
Expand Down

0 comments on commit 70f0c11

Please sign in to comment.