%PDF- %PDF-
Direktori : /usr/lib64/python2.7/site-packages/zmq/utils/ |
Current File : //usr/lib64/python2.7/site-packages/zmq/utils/garbage.pyo |
� +�{Wc @ s� d Z d d l Z d d l Z d d l m Z d d l m Z d d l m Z m Z m Z d d l Z d d l Z e d d d g � Z d e f d � � YZ d e f d � � YZ e � Z d S( sc Garbage collection thread for representing zmq refcount of Python objects used in zero-copy sends. i����N( t getpid( t namedtuple( t Threadt Eventt Lockt gcreft objt eventt GarbageCollectorThreadc B s e Z d Z d � Z d � Z RS( s4 Thread in which garbage collection actually happens.c C sA t t | � j � | | _ t | _ t � | _ t � | _ d S( N( t superR t __init__t gct Truet daemonR t pidR t ready( t selfR ( ( s7 /usr/lib64/python2.7/site-packages/zmq/utils/garbage.pyR s c C s? t d k s t � | j k r/ | j j � d Sz8 | j j j t j � } d | _ | j | j j � Wd | j j � Xx� t r0t d k s� t � | j k r� d S| j � } | d k r� Pn t | � d k r� d n d } t j | | � d } | j j j | d � } | r*| j r*| j j � n ~ q{ W| j � d S( Ni t DIEi t Lt Q( R t NoneR R t setR t contextt sockett zmqt PULLt lingert bindt urlR t recvt lent structt unpackt refst popR t close( R t st msgt fmtt keyt tup( ( s7 /usr/lib64/python2.7/site-packages/zmq/utils/garbage.pyt run s* ( t __name__t __module__t __doc__R R) ( ( ( s7 /usr/lib64/python2.7/site-packages/zmq/utils/garbage.pyR s t GarbageCollectorc B s� e Z d Z d Z d Z d Z d Z d d � Z e d � � Z e j d � � Z d � Z d � Z d � Z d � Z d � Z d d � Z d � Z RS( sN PyZMQ Garbage Collector Used for representing the reference held by libzmq during zero-copy sends. This object holds a dictionary, keyed by Python id, of the Python objects whose memory are currently in use by zeromq. When zeromq is done with the memory, it sends a message on an inproc PUSH socket containing the packed size_t (32 or 64-bit unsigned int), which is the key in the dict. When the PULL socket in the gc thread receives that message, the reference is popped from the dict, and any tracker events that should be signaled fire. s inproc://pyzmq.gc.01c C s` t t | � j � i | _ d | _ d | _ | | _ t � | _ t | _ t j | j � d S( N( R R- R R! R R t threadt _contextR t _lockt Falset _stay_downt atexitt registert _atexit( R R ( ( s7 /usr/lib64/python2.7/site-packages/zmq/utils/garbage.pyR O s c C s\ | j d k rU t j j d � rC d d l m } | j � | _ qU t j � | _ n | j S( Nt geventi����( t green( R/ R R R+ t startswithR R7 t Context( R R7 ( ( s7 /usr/lib64/python2.7/site-packages/zmq/utils/garbage.pyR Y s c C sB | j � r5 | j r( t j d t � n | j � n | | _ d S( Ns( Replacing gc context while gc is running( t is_aliveR! t warningst warnt RuntimeWarningt stopR/ ( R t ctx( ( s7 /usr/lib64/python2.7/site-packages/zmq/utils/garbage.pyR d s c C s t | _ | j � d S( s� atexit callback sets _stay_down flag so that gc doesn't try to start up again in other atexit handlers N( R R2 R>