Re: libseed-list g_async_queue



Alan Knowles wrote:
You might have better luck with the new Gir file http://devel.akbkhome.com/seed/GLib-2.0.gir

Which uses the new API
http://devel.akbkhome.com/seed/GLib.AsyncQueue.html

Is the new API == current seed git?

Also, excuse my ignorance but is the new Gir file something specific for seed or improvements for the official GLib Gir-file? I'm not sure I entirely understand the system for all this gir-stuff, but I thought the files where generated from the actual libs somehow.. Also there was a gir-repository, is that the place to get them from or how does it work?

pushing/pulling pointers though is going to be difficult to define an expected behaviour..

We could have some limited support, eg. only supporting gobject types both ways, but Gobject/structs as in arguments.
convert JS -> void* ==> wrapped Gobject/struct => pointer (this has some partial support now)
  convert void* -> JS
    ==> only support Gobject types (this is not supported at present)

That way GString could be used to send data as raw data.
and GValues could be used to store/retrieve JS data..

Wouldn't it work to just push the JSValueRef pointer as it is, and perhaps protect it from the GC while it's in the queue? Then one could just push whatever JS value to the queue and get it back as it was. But I'm surely missing something...

/Jonatan

Regards
Alan


--- On 24/Jun/2010, Jonatan Liljedahl wrote:
I'd like to use a GAsyncQueue to communicate between threads, but:

 > a = new GLib.AsyncQueue

** (seed:2468): CRITICAL **: Struct/union of type: AsyncQueue has size 0 in introspection data. Please check GIR
Segmentation fault

Trying the other way:

 > a = GLib.async_queue_new()
[object seed_struct]
 > GLib.async_queue_push(a,"hejsan")
 > GLib.async_queue_length(a)
1
 > GLib.async_queue_push(a,"hejsan")
 > x=GLib.async_queue_pop(a)
 > typeof x
undefined
 > GLib.async_queue_length(a)
0
 >

How can I get it to work?

It's a bit frustrating that the GLib/GObject bridge is only working for some stuff, and other times it requires a bit of guessing to figure out how to use them (like functions returning things to a pointer supplied as an arg, etc..)

/Jonatan

_______________________________________________
libseed-list mailing list
libseed-list gnome org
http://mail.gnome.org/mailman/listinfo/libseed-list

_______________________________________________
libseed-list mailing list
libseed-list gnome org
http://mail.gnome.org/mailman/listinfo/libseed-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]