Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ditch unused routing stuff

  • Loading branch information...
commit b8cf81ccea77f3bf77d30cc368e899dda0911126 1 parent 897b644
@mental authored
Showing with 0 additions and 33 deletions.
  1. +0 −33 src/Router.coffee
View
33 src/Router.coffee
@@ -1,33 +0,0 @@
-@WebActors ?= {}
-
-class Router
- constructor: ->
- @default_gateway = (actor_id, verb, param) ->
- @gateways = {}
-
- route_message: (actor_id, verb, param) ->
- gateway = null
- prefix = actor_id
- until (separator_index = prefix.lastIndexOf(":")) is -1
- prefix = actor_id.substr(0, separator_index)
- gateway = @gateways[prefix]
- break if gateway
- gateway = gateway or @default_gateway
- gateway(actor_id, verb, param)
- undefined
-
- register_gateway: (prefix, callback) ->
- @gateways[prefix] = callback
- undefined
-
- unregister_gateway: (prefix) ->
- delete @gateways[prefix]
- undefined
-
- set_default_gateway: (callback) ->
- @default_gateway = callback
- undefined
-
-@WebActors._router = new Router()
-
-@WebActors.Router = Router
Please sign in to comment.
Something went wrong with that request. Please try again.