JayThomason / Tutti

Tutti is a shared music application for the car being made in conjunction with Audi.
3 stars 1 forks source link

Change architecture of leaving jam solution #202

Closed JayThomason closed 10 years ago

JayThomason commented 10 years ago

Right now the clients periodically send a keep alive message to the master and the master periodically checks if it has received a keep alive message from each client. If the master has not received a keep alive message from a client since the last check then it removes that client from the jam.

I want to try out a different architecture. In this new solution, the master periodically pings each client asynchronously. If this ping ever fails, then the client is removed from the jam. This should solve the problem seen here: https://github.com/JayThomason/Tutti/issues/201

hwray commented 10 years ago

This is what I suggested here, not sure I communicated it well though:

https://github.com/JayThomason/Tutti/issues/163

As I pointed out there, it could place some extra strain on the master phone networking, which is already a bottleneck. We should also keep in mind that the master phone is likely to be the driver's phone and thus also likely to be turned off most often. This power manager thing sounds like a real bitch.

JayThomason commented 10 years ago

Yeah I remember you suggesting it. I had just implemented the other solution because I had just done it with the server right before.

Based on what I've seen so far, there is essentially a gap right after the phone's screen turns off where it sleeps too long. If this is the case then this new architecture should work well. However if we can't count on our threads being run reliably when the phone's screen is off then we might need to use the power manager.

JayThomason commented 10 years ago

done: https://github.com/JayThomason/Tutti/commit/7366ce87b2915a347730212d40a8402552aa42c1

hwray commented 10 years ago

killingit