halacious
halacious copied to clipboard
streams
Any plans on streaming representations?
Yes, I've given it some thought. What type of stream are you dealing with? An object stream that you'd like to embed into a collection?
Sent from my iPhone
On Sep 17, 2014, at 3:16 AM, stephen-bartell [email protected] wrote:
Any plans on streaming representations?
— Reply to this email directly or view it on GitHub https://github.com/bleupen/halacious/issues/41.
Exactly that, actually. I'm only streaming collections, and they're all object mode.
Streaming recursively embedded representations too. It's not something I'm doing right now, but see other people doing it as its a big feature of hal.
You can recursively embed now (albeit not with streams, obviously). You may have meant with streams but just making sure you're aware.
On 09/17/2014 10:08 AM, stephen-bartell wrote:
Exactly that, actually. I'm only streaming collections, and they're all object mode.
Recursively embedded representations too. It's not something I'm doing right now, but see other people doing it as its a big feature of hal.
— Reply to this email directly or view it on GitHub https://github.com/bleupen/halacious/issues/41#issuecomment-55898562.
Yep, I should've made that clear. It is now
Still thinking about this one. One stumbling block is that Halacious does its best to decorate an existing route rather than wholly define one. In other words, take out Halacious and all of your routes will still work. However, I don't see any way to implement streaming a HAL response without making it a Halacious-specific endpoint (because Hapi won't accept object streams).
Would it be possible to check the mode of an incoming stream and if it is objectMode, decorate it. The hapi user passing an object mode stream through halacious would have to already have something running later in the request lifecycle that converts that object stream for hapi - so you don't need to solve that problem here. This way, the behavior is the same with/without halacious.