Hey all,

I'm using zproject to design and build a library to extend zactor a bit. However I'm now running into a design issue when using callbacks.

For example I have in my api:
https://github.com/sphaero/libsphactor/blob/master/api/sphactor.api

    <callback_type name = "handler_fn">
        Callback function for socket activity
        <argument name = "msg" type = "zmsg" />
        <argument name = "arg" type = "anything" />
        <return type = "zmsg" />
    </callback_type>

So a callback which accepts a zmsg and returns a zmsg.

Works perfectly in C. However when I bind to Python it doesn't work. It seems Python(ctypes) only handles returning simple types from callbacks:

https://bugs.python.org/issue5710

I can see this doesn't apply to any api's I've found so for in czmq or zyre.

My question is whether it is bad api design from my side? Or are there any workarounds or better approaches for this?

Rg,

Arnaud
_______________________________________________
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
https://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to