예제 #1
0
def process_data(name=None):
    '''Fetch the current process local data dictionary. If *name* is not
``None`` it returns the value at *name*, otherwise it return the process data
dictionary.'''
    ct = current_process()
    if not hasattr(ct, '_pulsar_local'):
        ct._pulsar_local = {}
    loc = ct._pulsar_local
    return loc.get(name) if name else loc
예제 #2
0
파일: access.py 프로젝트: wilddom/pulsar
def process_data(name=None):
    '''Fetch the current process local data dictionary.

    If ``name`` is not ``None`` it returns the value at``name``,
    otherwise it return the process data dictionary
    '''
    ct = current_process()
    if not hasattr(ct, '_pulsar_local'):
        ct._pulsar_local = {}
    loc = ct._pulsar_local
    return loc.get(name) if name else loc
예제 #3
0
def process_data(name=None):
    """Fetch the current process local data dictionary.

    If ``name`` is not ``None`` it returns the value at``name``,
    otherwise it return the process data dictionary
    """
    ct = current_process()
    if not hasattr(ct, "_pulsar_local"):
        ct._pulsar_local = {}
    loc = ct._pulsar_local
    return loc.get(name) if name else loc
예제 #4
0
 def _local(self, v):
     current_process()._event_loop_policy = v
예제 #5
0
 def _local(self):
     l = getattr(current_process(), '_event_loop_policy', None)
     if l is None:
         self._local = l = self._Local()
     return l
예제 #6
0
 def _local(self, v):
     current_process()._event_loop_policy = v
예제 #7
0
 def _local(self):
     l = getattr(current_process(), '_event_loop_policy', None)
     if l is None:
         self._local = l = self._Local()
     return l