PageRenderTime 26ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/lib/Session.io

http://github.com/pgregory/blackpool
Unknown | 28 lines | 24 code | 4 blank | 0 comment | 0 complexity | 9018f3b7b6f5deff4da26bea411e40a1 MD5 | raw file
  1. Session := Object clone do(
  2. init := method(
  3. callbacks ::= Registry clone
  4. )
  5. handle := method(request, response,
  6. request getParameters foreach(k, v,
  7. callback := callbacks find(k)
  8. if(callback,
  9. callback second call(v, request)
  10. )
  11. )
  12. k := request getParameters at("_k")
  13. if(k,
  14. callback := callbacks find(k)
  15. if (callback,
  16. callback second call(request)
  17. )
  18. )
  19. html := Canvas clone
  20. html callbacks = callbacks
  21. html render(root)
  22. response setBody(html result)
  23. )
  24. )