simple static declarations, rather than complex compile-time logic
no longer need separate tracking of socket option types either, can be tracked on SocketOption enum itself
this means `Frame.buffer` *may* be reconstructed if references to the cached value expire
Frame.buffer is also `memoryview(Frame)` instead of `memoryview(Frame.data)` which means it holds a reference to the Frame itself,
not a direct reference to the underlying data.
Previously, `Frame.buffer` or `memoryview(Frame)` would result in a
readonly view with the cython backend. This was originally done for
safety since concurrent sends and modifications of a Frame are unsafe.
e.g. if you modify data before a non-copying send is fully done you
would corrupt your message. However, modifying data before the send is
complete is a more general issue and making the view readonly only
protected the case where you're sending data you previously received,
but would not help when sending other arbitrary mutable data. See 1566
for more info.
Making the view writeable allows users to avoid a copy when doing things
like creating a mutable numpy array from a non-copying recv so this is
making a tradeoff between speed and a little bit of safety.
Resolves 1566
Previously, `__buffer__` was returning the raw `_buffer`, which isn't
always set. This resulted in `None` being returned, which caused type
errors about Frame not supporting the buffer interface. Switch to
returning `buffer`, which will set `_buffer` if it isn't already.
Part of 1566
Just trying to satisfy the license classifiers out there - this license is actually named "GNU Lesser General Public License", not "Lesser GNU General Public License".
auto close&term are implemented in `__del__` in sugar wrappers, which are more reliable when called
when `__del__` is skipped, e.g. in process teardown, don't trust dealloc to work as context may be deallocated before sockets
dealloc ordering makes things prone to hang on process teardown
zmq source has some comments indicating pitfalls related to threadsafety
it appears to claim to have solved this with statics and locks (not sure),
but behavior suggests this may not be so.
- remove implicit relative imports
- backend/cython, devices no longer need to be on include path
- set language_level to 3str explicitly
- define zmq/__init__.pxd and zmq.backend.cython.__init__.pxd for package-level cimports
- test cython compilation with pyximport