[zeromq-dev] pyczmq: zloop callback arguments?

Michael Haberler mail17 at mah.priv.at
Wed Nov 20 13:09:32 CET 2013


I'm stuck at passing 'self' as a timer callback argument:

Class Test:

    @ffi.callback('zloop_fn')
    def timer_event(loop, item, arg): 
       print type(loop), type(item), type(arg)

    def __init__(self):
	...
        zloop.timer(self.loop, msec, 1, self.timer_event, self)
	# this raises: TypeError: initializer for ctype 'void *' must be a cdata pointer, not instance

how do I coerce this into action?

- Michael


More information about the zeromq-dev mailing list