_zmq.pxd 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # cython: language_level = 3str
  2. """zmq Cython backend augmented declarations"""
  3. # Copyright (C) PyZMQ Developers
  4. # Distributed under the terms of the Modified BSD License.
  5. from zmq.backend.cython.libzmq cimport zmq_msg_t
  6. cdef class Context:
  7. cdef object __weakref__ # enable weakref
  8. cdef void *handle # The C handle for the underlying zmq object.
  9. cdef bint _shadow # whether the Context is a shadow wrapper of another
  10. cdef int _pid # the pid of the process which created me (for fork safety)
  11. cdef public bint closed # bool property for a closed context.
  12. cdef inline int _term(self)
  13. cdef class MessageTracker(object):
  14. cdef set events # Message Event objects to track.
  15. cdef set peers # Other Message or MessageTracker objects.
  16. cdef class Frame:
  17. cdef zmq_msg_t zmq_msg
  18. cdef object _data # The actual message data as a Python object.
  19. cdef object _buffer # A Python memoryview of the message contents
  20. cdef object _bytes # A bytes copy of the message.
  21. cdef bint _failed_init # flag to hold failed init
  22. cdef public object tracker_event # Event for use with zmq_free_fn.
  23. cdef public object tracker # MessageTracker object.
  24. cdef public bint more # whether RCVMORE was set
  25. cdef Frame fast_copy(self) # Create shallow copy of Message object.
  26. cdef class Socket:
  27. cdef object __weakref__ # enable weakref
  28. cdef void *handle # The C handle for the underlying zmq object.
  29. cdef bint _shadow # whether the Socket is a shadow wrapper of another
  30. # Hold on to a reference to the context to make sure it is not garbage
  31. # collected until the socket it done with it.
  32. cdef public Context context # The zmq Context object that owns this.
  33. cdef public bint _closed # bool property for a closed socket.
  34. cdef public int copy_threshold # threshold below which pyzmq will always copy messages
  35. cdef int _pid # the pid of the process which created me (for fork safety)
  36. cdef void *_draft_poller # The C handle for the zmq poller for draft socket zmq.FD support
  37. # cpdef methods for direct-cython access:
  38. cpdef object send(self, data, int flags=*, bint copy=*, bint track=*)
  39. cpdef object recv(self, int flags=*, bint copy=*, bint track=*)
  40. cpdef int recv_into(self, buffer, int nbytes=*, int flags=*)