class_docstr: Create a zmq Context
  
  A zmq Context creates sockets via its ``ctx.socket`` method.
class_docstr_tok: ["Create","a","zmq","Context","A","zmq","Context","creates","sockets","via","its","``","ctx.socket","``","method","."]
docstr: Close all sockets associated with this context and then terminate
  the context.
  
  .. warning::
  
      destroy involves calling ``zmq_close()``, which is **NOT** threadsafe.
      If there are active sockets in other threads, this must not be called.
  
  Parameters
  ----------
  
  linger : int, optional
      If specified, set LINGER on sockets prior to closing them.
docstr_tok: ["Close","all","sockets","associated","with","this","context","and","then","terminate","the","context",".","..","warning",":",":","destroy","involves","calling","``","zmq_close","(",")","``",",","which","is","*","*","NOT","*","*","threadsafe",".","If","there","are","active","sockets","in","other","threads",",","this","must","not","be","called",".","Parameters","--","--","--","--","--","linger",":","int",",","optional","If","specified",",","set","LINGER","on","sockets","prior","to","closing","them","."]
code: def destroy(self, linger=None):
      """Close all sockets associated with this context and then terminate
      the context.
  
      .. warning::
  
          destroy involves calling ``zmq_close()``, which is **NOT** threadsafe.
          If there are active sockets in other threads, this must not be called.
  
      Parameters
      ----------
  
      linger : int, optional
          If specified, set LINGER on sockets prior to closing them.
      """
      if self.closed:
          return
  
      sockets = self._sockets
      self._sockets = WeakSet()
      for s in sockets:
          if s and not s.closed:
              if linger is not None:
                  s.setsockopt(LINGER, linger)
              s.close()
  
      self.term()
  
imports: import atexit
  import os
  from threading import Lock
  from weakref import WeakSet
  from zmq.backend import Context
  from .None import constants
  from .attrsettr import AttributeSetter
  from .constants import ENOTSUP, LINGER, ctx_opt_names
  from .socket import Socket
  from zmq.error import ZMQError
label_desc: Use image node_id 13 for calling the Context obj's underlying member method code with example usage: obj.destroy(linger) without return types