maddsua / lambda

HTTP and Websocket server library
MIT License
3 stars 0 forks source link

Plans for v3 #177

Open maddsua opened 3 months ago

maddsua commented 3 months ago

Since lambda is almost exclusively uses as an application server (well no sheet since it lacks TLS and http2 support lol), it really makes sense to remove all the unnecessary parts from it. Although leaving some room for pluggable components inside the pipeline might not be a bad idea, the basic version of lambda should only ship these components:

  1. HTTP/1.1 web server with keep-alive support. Add a reverse proxy after it and boom - you've got a full blown production ready server. The server should expose a Fetch-list API with body streaming support for both request and response.
  2. A simple TCP listener with thread pool to accept those http requests and queue their processing.
  3. REST API adapter - JSON parser/serializer + helper functions.
  4. A basic router - well, to handle routing duh. Also, it can be made specifically for REST - this way it would get real close to some sort of JSON RPC or kinda like TRPC.
  5. WebSocket and SSE modules.

This way, the base version of lambda would not depend on any external libs (such as brotli or zlib) and it would make it easy to extend the library as needed. Speaking of useless features, those will be eliminated. Let's face it - nobody, not even me, uses that KV storage or a virtual filesystem. Those simply should not be a part of this library.