Burgestrand / Hallon

Hallon is currently **UNMAINTAINED**.
http://rdoc.info/github/Burgestrand/Hallon/master/frames
135 stars 12 forks source link

Synchronous mode #122

Closed Burgestrand closed 12 years ago

Burgestrand commented 12 years ago

Hallon is mature enough to start putting this major feature in. Most usage of Hallon is going to be synchronous, and even if some things are way more optimized to do in an asynchronous fashion, and then loading objects in bulk, the most common case is just browsing objects.

As for the optimized bulk-load way to do this, I was thinking something along:

Hallon.bulk_load do
   Track.new(uri)
   Album.new(uri)
   pre_existing_playlist.tracks
end # => blocks until all objects created inside have loaded, returns an array of all objects (or two arrays, one loaded, one not?)

This could easily be done by overloading .new on all classes implementing Loadable.

Burgestrand commented 12 years ago

The synchronous part is easy to fix. However, the bulk load is a bit trickier.

This issue stems from that Hallon is (sometimes) unnecessarily low-level. I’d love to do an API overhaul and see what can be thrown/moved away…

Burgestrand commented 12 years ago

Synchronous loading will come in v1.0.0, but it will be implicit and part of how Hallon works in general. I’ll be closing this issue for this reason.