[zeromq-dev] czmq python bindings and signals

Wes Young wes at barely3am.com
Mon Aug 1 19:10:38 CEST 2016


hi,

i’m working on a cross example “chat" between pyzmq and zyre (based on pyre), lets assume for a sec i have it mostly working (re-casting czmq objects into pyzmq sockets, etc).

is there a way to interact with zsys_handler_set via the python bindings that i’m missing? it seems like the lower level actors are sucking up the SIGINTs so the high level python app doesn’t catch them correctly.

it appears that the [czmq] java bindings dealt with handling signals by adding a zsys_handler_set(NULL) shim to the JNI init, and from what i can tell, if i manually add this to the ctypes under bindings/python for ZSock, it appears to “do the right thing”, but i also assume it means i’m either missing something stupid here (use the loops dummy!) or i need to patch something in czmq to expose this a bit more(?) to python (less likely?)

but i can’t tell if/where i should be touching the gsl under zproject to expose / or work with this interface via python…

(i also assume, that aybe if i setup zloop correctly, this might have the right effect in catching SIGINTs?)

thoughts?

https://gist.github.com/wesyoung/1564c24b6615d47c8af9b7ee6b31df07
--
wes
wesyoung.me

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20160801/fa2fd334/attachment.sig>


More information about the zeromq-dev mailing list