News for hackers. Stuff that matters.
Re:Rust for C++ programmers – part 3: primitive types and op... by AlisdairO on Wednesday April 23, 2014 @06:20AM (#7633104)
It's not that uncommon to want to recover from NPEs in a webapp environment. You want your thread of execution to error out, return a 500, and rollback whatever db changes it's made, but you want the webapp as a whole to keep running.
Re:Rust for C++ programmers – part 3: primitive types and op... by lucian1900 on Wednesday April 23, 2014 @09:11AM (#7633690)
And this is precisely what task failure in Rust lets you do. Requests run in tasks, if the task fails, show an error message and make a new task for the next request.
Re:Rust for C++ programmers – part 3: primitive types and op... by AlisdairO on Wednesday April 23, 2014 @11:11AM (#7634421)
Yes, sorry - I wasn't meaning to state that rust is bad in this regard. Just addressing the point of catching NPEs and so on.
Re:Rust for C++ programmers – part 3: primitive types and op... by alkonaut on Wednesday April 23, 2014 @10:52AM (#7634281)
Of course when you have a web application running requests using some thread pool or even more lightweight worker, then what we call the "application" is likely the request and you most likely don't want to kill the app server because you have good reason to believe the other requests are unaffected by the failing requests.