Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Aleksandro Newsgroups: comp.lang.javascript Subject: Re: Server side push.....? Date: Tue, 22 Mar 2016 18:55:26 -0300 Organization: A noiseless patient Spider Lines: 36 Message-ID: References: <57c45602-9198-451a-9b17-cda497126b6e@googlegroups.com> <88126020-bead-4bf5-8072-8233f58d31e9@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Injection-Date: Tue, 22 Mar 2016 21:52:18 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="7363fa7664fe264696fafdff2cecae6a"; logging-data="31713"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ikYtRrBxe7q6/EuyLmyWXZwaccQdyle0=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 In-Reply-To: <88126020-bead-4bf5-8072-8233f58d31e9@googlegroups.com> Cancel-Lock: sha1:OL9+P3+kChc0qC0GkN3eqaKLiXA= Xref: csiph.com comp.lang.javascript:30085 On 22/03/16 04:18, bit-naughty@hotmail.com wrote: > On Tuesday, March 22, 2016 at 1:33:18 AM UTC+5:30, Aleksandro wrote: > >> >> I would see if the playback API emits some event on finish or I would >> poll for it's status first. > > Sorry I didn't understand this statement - what is the meaning of "playback API"? The API (you must know what that is) that is exposed in the client side by whatever element you are using to perform the actual playback. > What are you expecting from the server side, exactly? (since, in this case, *I* will be programming both ends....:) ) The data you want to fetch, of course. > Does the name updating run independently of the song playing? Amongst other things, when a new user connects to the stream, they should get the name of the song playing *now*...... That sounds like metadata, it can be in the stream itself, but it depends on the stream type of course. > The AJAX stuff runs simultaneously with the rest of the stuff like audio streaming, right? It's programmatic, you make it run as you see fit. Excessive polling will tire you server though. > i.e it's "get the name of a new song, get it's cover, show both" right? Does that mean it's multitasking, like, does it need WebWorkers or something? Javascript is always multi-tasking. I don't have experience with WebWorkers but you don't need them. > How would you "poll for its status"? When? If the interface won't emit any of the events I want to listen to, I would set up an interval checking it's status every 500ms or 1s.