Serve Your Music Collection Using HTML5, Backbone, and Flask
1–10 of 86 posts
Re: Serve Your Music Collection Using HTML5, Backbone, and Flask
#2Re: Serve Your Music Collection Using HTML5, Backbone, and Flask
#3How did you deal with multiple simultaneous requests? (two clients streaming at the same time, two clients encoding at the same time, etc)
I really wish there was an nginx header like X-Accel-Redirect called X-Accel-FD where I could pass it a file descriptor to send the data directly, with SIGPIPE set up fine. That way I wouldn't have to buffer from the application process.
Wait a second. Here's an idea -- maybe I can just pass a fifo file to X-Accel-Redirect... I'll give that a whirl. One potential issue here is that it's not going to behave nicely with the client terminating the connection prematurely -- it'll leave a zombified process or a filled pipe or both. So maybe this isn't best then. Any suggestions here? I'd like to not wind up rolling my own nginx module for this.
That said, the current solution works very well, and in my tests works great with several clients transcoding. My server is pretty underpowered, but it doesn't seem to have much of an issue.
Re: Serve Your Music Collection Using HTML5, Backbone, and Flask
#4Re: Serve Your Music Collection Using HTML5, Backbone, and Flask
#5How did you deal with multiple simultaneous requests? (two clients streaming at the same time, two clients encoding at the same time, etc)
The Linux process scheduler deals with it, I guess. I suppose I could add some kind of my own limiting mechanism, but since encoding ties up the application process, I figure it's limited to how uwsgi works with this kind of thing (multiple child processes, threads, event loops, whatever). I really wish there was an nginx header like X-Accel-Redirect called X-Accel-FD where I could pass it a file descriptor to send t…
Re: Serve Your Music Collection Using HTML5, Backbone, and Flask
#6Re: Serve Your Music Collection Using HTML5, Backbone, and Flask
#7Looks really interesting. Do you have a live demo, possibly with public-domain music? Would love to try it out without yet building it on a server.
On the plus side though, it's super easy to try it out locally using the built-in server:
Give backend/app.cfg the path of the music on your computer. Then run backend/local_server.py. Browse to localhost:5000 in your web browser, and you're set.
Re: Serve Your Music Collection Using HTML5, Backbone, and Flask
#8Re: Serve Your Music Collection Using HTML5, Backbone, and Flask
#9Curious as to why you aren't hosting this on github? I would have loved to star it and then come back later.
Re: Serve Your Music Collection Using HTML5, Backbone, and Flask
#10Curious as to why you aren't hosting this on github? I would have loved to star it and then come back later.
(I also happen to be the maintainer of cgit...)
Anyway, if you really must have it, I do mirror all my git repos to github as a free backup. Look under my account -- zx2c4.