yada

2017-10-02T16:57:43.000241Z

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?

malcolmsparks 2017-10-02T16:59:53.000285Z

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.

2017-10-02T17:04:25.000189Z

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.

dominicm 2017-10-02T17:54:45.000005Z

@danielcompton I'm not on github right now, but pretty reverses the stack trace, if that's what you mean

kpsf 2017-10-02T18:15:10.000049Z

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?

danielcompton 2017-10-02T19:50:46.000469Z

@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

dominicm 2017-10-02T19:52:19.000672Z

Okay, just checking you knew it wasn't a bug :)

dominicm 2017-10-02T19:52:31.000111Z

It must be fixable, because boot did it

danielcompton 2017-10-02T19:53:11.000027Z

Yeah, you can tell it to reverse

dominicm 2017-10-02T19:53:53.000062Z

Okay great