scirelli / nightshade

Three Stooges Repo.
0 stars 0 forks source link

Use Q for queries multiple datasources #10

Open scirelli opened 10 years ago

scirelli commented 10 years ago

https://github.com/kriskowal/q

arflores2 commented 10 years ago

@scirelli what do you need the Yelp service to return? A promise?

scirelli commented 10 years ago

I can work around that if you don't want to modify it. Your codes pretty bad. I'm just going to make something for meetup and see if I can work yelp in. On Jan 14, 2014 8:49 AM, "Angel Flores" notifications@github.com wrote:

@scirelli https://github.com/scirelli what do you need the Yelp service to return? A promise?

— Reply to this email directly or view it on GitHubhttps://github.com/scirelli/nightshade/issues/10#issuecomment-32265456 .

arflores2 commented 10 years ago

That is why I'm asking. What does the aggregator expect? I know I need to refactor my code but it would be better if I new what your service is expecting.

scirelli commented 10 years ago

Ok simplest for you if you want is to have a callback for success and for errors. U seem to have a success one, add one for errors so we can track when a service fails. I can then use a defferer to do the rest.

Or you can return a promise. On Jan 14, 2014 9:11 AM, "Angel Flores" notifications@github.com wrote:

That is why I'm asking. What does the aggregator expect? I know I need to refactor my code but it would be better if I new what your service is expecting.

— Reply to this email directly or view it on GitHubhttps://github.com/scirelli/nightshade/issues/10#issuecomment-32267145 .

arflores2 commented 10 years ago

Thanks for the info!

arflores2 commented 10 years ago

@scirelli Does the aggregator handle categorization or does the translator handle that? I would say the translator handles the categorization since it should be the only thing aware of the data structure of the data source response.

scirelli commented 10 years ago

Ehh? The aggregater, from what I think we discussed, will be notified that there was some change, and it should fire off the sources (idk what you're calling them), the source know what the change was, change in category, location, whatever. Once all the source data is gathered it will pass it back to the client.

So I guess the client will say "the user wants information on this location (10.1, 23.2) with these [categories]...categories being optional, no categories means all categories:

Option 1: All data sources can create their query method for the new query, and give that method to the aggregator. Once it gets them all it can fire them all off, GOTO Z

Option 2: Or they can already have a method registered with the aggregator. Once all sources have been notified of the change in query, the aggregator can be called to fire off all the queries. GOTO Z

Z: Once all the data has been gathered by the aggregator it passes that to a class that does w.e it wants to the data then returns it to the client.

But that's just off the top of my head. Let me know what you think....but i can't respond frequently bc i'm at work, and i have to work at work.

On Thu, Jan 16, 2014 at 11:13 AM, Angel Flores notifications@github.comwrote:

@scirelli https://github.com/scirelli Does the aggregator handle categorization or does the translator handle that? I would say the translator handles the categorization since it should be the only thing aware of the data structure of the data source response.

— Reply to this email directly or view it on GitHubhttps://github.com/scirelli/nightshade/issues/10#issuecomment-32483342 .

Steve Cirelli Cell: 347-618-1144 KK4FRG

Email Charter http://emailcharter.org/

arflores2 commented 10 years ago

I follow. Are you at a point to commit some code?

scirelli commented 10 years ago

No On Jan 17, 2014 8:41 AM, "Angel Flores" notifications@github.com wrote:

I follow. Are you at a point to commit some code?

— Reply to this email directly or view it on GitHubhttps://github.com/scirelli/nightshade/issues/10#issuecomment-32606273 .