Hi Michel,

Am 18.11.2013 um 04:52 schrieb Michel Pelletier <[email protected]>:

> This uses ctypes.Structure.from_buffer to copy objects to and from an mmaped 
> file with no serialization, in theory the only serializing happens "out of 
> process" by the kernel to and from the mapped file.  Maybe some ideas here 
> might help?

well, it was all in place anyway - it turns out that using zframe.data(f) is 
sufficient because this supports enough of the buffer protocol to work:

 f = zframe.recv(socket)
 self.rx.ParseFromString(zframe.data(f))

the sending side just becomes:

 zframe.send(zframe.new(self.tx.SerializeToString()), socket, 0)

---

re keyboard interrupt: I solved this by testing for  zpoller.terminated(poller) 
in the inner loop which I prefer anyway since it's synchronous delivery.



I think what warrants some thought longer term: if errors from pyczmq calls 
should raise exceptions or not. It's a very C-ish interface which requires a 
lot of asserts around calls.


- Michael


_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to