Waiiiit, if we can return closures from functions now - creating middleware should be a lot easier: ``` fn main () { for conn in server { let timer_done = timer(); /* run server code */ timer_done(); } } ``` Maybe with Drop semantics this can be even better?
-
-
Btw, this is the same idea executed in ES5. https://github.com/yoshuawuyts/nanostack#how-does-this-work … Wondering how to achieve this in Rust.
Show this threadThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Yes, it's important that middlewares get control back once all subsequent middlewares have been executed. That was one thing that really bugged me with Express.
-
hehe, yeah same. Just realized Rust's Gotham framework offers this btw. Pretty neat! :D
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.