scottclin / etontables

A client server based torrenting in go. Mostly because learning go.
GNU General Public License v2.0
0 stars 0 forks source link

Information Sharing #9

Open scottclin opened 8 years ago

scottclin commented 8 years ago

Ok this is going to be an interesting one. Not sure how we are going to deal with this like for example sending it to the user. What would be the way you think? Giant data dump then change events?

voidshard commented 8 years ago

Hey! Sorry I'm a bit dead online at the moment, over in Brisbane mostly outside. Is terrible I know :(

Server status information channel - good plan!

Thoughts - A thread reads map[string]interface from the server information channel and keeps a master map[string]interface struct. Incoming data is merged into master and any key collisions are overwritten with the new data. Perhaps the thread might be able to be configured to write out the current server status data to .json or some such, with a datestamp / perhaps even remove data older than X files back or something -- just a thought.

Then it should be easy to request a copy of the current master from the holding thread. Alternatively, if we always write out datestamp.json and symlink current.json then any thread can simply ask to have the contents of current.json returned - might be easier to implement. Much more IO I guess