In Aleph we have to be careful not to block the thread in the request handler (I think), instead we can use streams, deferred etc. In Yada we can return a modified context map, does that mean that if we have blocking operations in the handler we are blocking a server thread? Ie. if I have synchronous code, or a Thread/sleep in my handler, database call etc. what would be the way to do this inside a Yada handler? I don’t remember seeing anything special done in the yada examples I have seen so far (ex. phonebook), maybe there was no need in these particular examples (in-memory atom instead of a DB call)? Is there a document that clarifies the “yada memory model”? Maybe an example of composing synchronous/blocking slow functions in a Yada handler?
Hi @nha. You should avoid blocking APIs in your yada code. Where you must block, you should use a future. Where you call use a callback API, use a promise.
Ok that makes sense 🙂 I though about it when reading aleph docs, it probably should be mentioned somewhere for yada as well (unless I missed it), even if this is just a link to aleph.
@danielcompton I'm not on github right now, but pretty reverses the stack trace, if that's what you mean
Hi, I'm looking to use Yada with multipart/mixed as the mime-type. Is this supported and if it is, how would I access the parameters?
@dominicm yeah, it reverses the stack trace which is good in the console, but bad rendering to HTML cause you start reading from the top
Okay, just checking you knew it wasn't a bug :)
It must be fixable, because boot did it
Yeah, you can tell it to reverse
Okay great