Hi Anton!
If I'm understanding your needs (wanting to dynamically generate
streamed binary content), there isn't a great way to deal with this.
There are two ways to deal with this:
1) Using the underlying server's streaming mechanisms (such as making
a cowboy-specific dispatch table to targets a cowboy handler module to
deal with the streaming), or a yaws outfile.
2) Using cowboy, there's a bit of a hack that can work in
simple_bridge if you're using cowboy. If your module's main() function
returns the tuple: {stream, StreamFun} where StreamFun is a function
with arity 2 that (fun(Socket, Transport) - Transport being a ranch
transport). Really, this is just a shortcut way that allows you to
use Transport:send(socket) to send data. I'll admit I haven't done
this before, but it should work with a little bit of tinkering.
Adding this as an actual option to simple_bridge and Nitrogen would
probably be worthwhile.
If, however, you are just generating a small-ish amount of data, then
doing as Stuart recommends would be much easier.
-Jesse
> --
> You received this message because you are subscribed to the Google Groups
> "Nitrogen Project / The Nitrogen Web Framework for Erlang" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
nitrogenweb...@googlegroups.com.
> To post to this group, send email to
nitro...@googlegroups.com.
> Visit this group at
http://groups.google.com/group/nitrogenweb.
> For more options, visit
https://groups.google.com/groups/opt_out.
--
Jesse Gumm
Owner, Sigma Star Systems
414.940.4866 ||
sigma-star.com || @jessegumm