Esempio n. 1
0
    def _stop_info(self, data):
        '''_stop_info

        When an object is being returned to the queue, stop recording
        trace information in the thread that removed the object from
        the queue.
        '''
        thrd = coro._get_thread(data.get('thread', 0))
        if thrd is not None:
            thrd.trace(False)

        return data
Esempio n. 2
0
    def find(self):
        '''find

        Return information about each object that is currently checked out
        and therefore not in the queue.

          caller - execution stack trace at the time the object was
                   removed from the queue
          thread - coroutine ID of the thread executing at the time the
                   object was removed from the queue
          trace  - current execution stack trace of the coroutine which
                   removed the object from the queue
          time   - unix timestamp when the object was removed from the
                   queue.
        '''
        saved = self._item_save.copy()
        for oid, data in saved.items():
            thread = coro._get_thread(data['thread'])
            if thread is None:
                data.update({'trace': None})
            else:
                data.update({'trace': thread.where()})

        return saved