On Sun, Oct 7, 2012 at 9:10 PM, Michael Torrie <torr...@gmail.com> wrote:
> Maybe the best way is to avoid processes or threads altogether.  Since
> downloading this thumbnail is io-bound, not cpu-bound, once you send off
> your request, just use io watches to trigger the main loop when
> something has come in.

Agreed, better yet, the code could become much simpler using an async pixbuf:

def on_image_ready(stream, res, user_data):
    pixbuf = GdkPixbuf.Pixbuf.new_from_stream_finish(res)
    ...
file = Gio.File.new_for_uri("...")
GdkPixbuf.Pixbuf.new_from_stream_async(file.read(None), None,
on_image_ready, None)

All within a main loop of course.

-Simon
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to