I'm trying to understand how one should design middlewares for EWGI compatibility. Given that there is no EWGI compliant web server yet, I can only ask for your opinion.
If I understand the spec. correctly, a middleware receives an #ewgi_context{} record as input, and returns another record of the same type.
Question is, is the middleware going to be called twice as in django, or is it supposed to call the rest of the middlewares on its own recursively?
Also, is there any proposed way for a middleware to notify the rest of the middlewares that its result is supposedly the final response? (e.g. the file-serving middleware hit a file, so there is no point calling the view middleware). As the result of my view is a context record, how should the rest of the middlewares (or the server) figure out it is the final response?