context.pxd 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. """0MQ Context class declaration."""
  2. #
  3. # Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
  4. #
  5. # This file is part of pyzmq.
  6. #
  7. # pyzmq is free software; you can redistribute it and/or modify it under
  8. # the terms of the Lesser GNU General Public License as published by
  9. # the Free Software Foundation; either version 3 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # pyzmq is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # Lesser GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the Lesser GNU General Public License
  18. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. #
  20. #-----------------------------------------------------------------------------
  21. # Code
  22. #-----------------------------------------------------------------------------
  23. cdef class Context:
  24. cdef object __weakref__ # enable weakref
  25. cdef void *handle # The C handle for the underlying zmq object.
  26. cdef bint _shadow # whether the Context is a shadow wrapper of another
  27. cdef int _pid # the pid of the process which created me (for fork safety)
  28. cdef public bint closed # bool property for a closed context.
  29. cdef inline int _term(self)