Using Glib.AsyncQueue, "try using a constructor"
self.queue = GLib.AsyncQueue()
TypeError: struct cannot be created directly; try using a constructor, see: help(GLib.AsyncQueue)
It doesn't look like there is any classmethod available for constructing one, here is its __dict__
:
{'__info__': StructInfo(AsyncQueue), '__module__': 'gi.repository.GLib', '__gtype__': <GType void (4)>, '__dict__': <attribute '__dict__' of 'AsyncQueue' objects>, '__weakref__': <attribute '__weakref__' of 'AsyncQueue' objects>, '__doc__': None, 'length': gi.FunctionInfo(length), 'length_unlocked': gi.FunctionInfo(length_unlocked), 'lock': gi.FunctionInfo(lock), 'pop': gi.FunctionInfo(pop), 'pop_unlocked': gi.FunctionInfo(pop_unlocked), 'push': gi.FunctionInfo(push), 'push_front': gi.FunctionInfo(push_front), 'push_front_unlocked': gi.FunctionInfo(push_front_unlocked), 'push_unlocked': gi.FunctionInfo(push_unlocked), 'ref_unlocked': gi.FunctionInfo(ref_unlocked), 'remove': gi.FunctionInfo(remove), 'remove_unlocked': gi.FunctionInfo(remove_unlocked), 'timed_pop': gi.FunctionInfo(timed_pop), 'timed_pop_unlocked': gi.FunctionInfo(timed_pop_unlocked), 'timeout_pop': gi.FunctionInfo(timeout_pop), 'timeout_pop_unlocked': gi.FunctionInfo(timeout_pop_unlocked), 'try_pop': gi.FunctionInfo(try_pop), 'try_pop_unlocked': gi.FunctionInfo(try_pop_unlocked), 'unlock': gi.FunctionInfo(unlock), 'unref': gi.FunctionInfo(unref), 'unref_and_unlock': gi.FunctionInfo(unref_and_unlock)}
I also can't see anything in the docs:
https://lazka.github.io/pgi-docs/#GLib-2.0/classes/AsyncQueue.html
Idk, help(GLib.AsyncQueue)
also doesn't really help
Via the github code search I wasn't able to find an example for Glib.AsyncQueue in python