-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add thread capabilities for async requests. #117
Comments
Hi @omarps . Are you talking about the node-trello? I don't think that this is a good idea to bring something like that to this Gem. Node is a event-driven environment. And using threads could potentially increase the complexity of the Gem. Also it will only be helpful in worker jobs as in normal HTTP requests we usually don't have anything to postpone the response. I think that the best approach is to create something new using event machine if that's what your talking about. What do you think? =] |
Hi @viniciusoyama, I'm refering to the kind execution process that is made when you use the Trello's JavaScript API. For example, you could launch a method to get some boards and in the callback method, start querying for the lists' cards. I have a project that navigates thought the Board/List/Cards/Users hierarchy that works pretty well, but when I tried to migrate the logic to to a Rails Project and start using the ruby-trello gem, it takes longer than expected just to load the Boards. That's what am I asking for some thread approach to solve this. |
Anyone have any ideas on how to realize this w/o breaking how the API currently works too much? If there are some good ideas here, I'd love to consider them for 2.0. This and #116 would be nice to have a discussion on for 2.0 planning. |
Hey @jeremytregunna can you help me with some scenarios? With the current API, if I want to make async operations I have to open threads: Thread.new do
user = Trello::Member.find("user1")
#save things..
end
Thread.new do
user = Trello::Member.find("user2")
#save things..
end
#... For 2.0 you want something like this: Trello::Member.find("user1") do |user|
#save things
end
Trello::Member.find("user1") do |user|
#save things
end Is that it? Sorry I'm trying to understand what you guys want in order to help. |
Comparing with the Official Javascript Library, this gem is not async, so you can yo and wrap the requests in a Thread implementation (or even Fiber), but it would be nice, if the gem itself provides async methods to improve the performance.
The text was updated successfully, but these errors were encountered: