phpactor / language-server

Generic Language Server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Middleware Refactor

dantleech opened this issue · comments

  • All handlers should be session based
  • Dispatcher should be the extension point of the server
  • Handlers should be implemented as middlewares
  • Middlewares are however an implementation detail of the Dispatcher implementation.

Example:

  • The existing "system handlers" can be made into middlewares
  • The exisitng handler decorators transition well to middlewares.
  • The (for example) Phpactor implementation can be implemented as a middleware - replacing the "HandlerLoader" interface.

Consequences:

  • Middlewares can be instantiated per session with necessary dependencies: can stop passing special dependencies as method arguments.