xissy / node-grooveshark-streaming

A node.js module for getting a music streaming url from Grooveshark without any API authentication.
23 stars 4 forks source link

Break each step out into functions #1

Closed yocontra closed 11 years ago

yocontra commented 11 years ago

Would help this be more modular. Your tokens expire after a certain point so re-running only the needed part to refresh it would be easier than doing the whole process

xissy commented 11 years ago

@Contra Thank you for your concern. Actually that's what I tried to do.

I've used this library at server-side, that means a lot of users can access this library concurrently. At that time, if we try to re-use a session then the conflict can be occurred because of node.js' event driven architecture.

To avoid this conflict, I had to implement some data structures like a session map so I decided to skip optimizing to maintain its simplicity.

Anyway this is what I experienced. But if you have any other awesome ideas then please let me know. Surely always welcome your pull requests.