Beispiel #1
0
    def __init__(self, lock, pupy_srv, *args, **kwargs):
        self._sync_events = {}
        self._connection_serve_lock = lock
        self._last_recv = time.time()
        self._ping = False
        self._ping_timeout = 2
        self._serve_timeout = 10

        if 'ping' in kwargs:
            ping = kwargs.get('ping')
            del kwargs['ping']
        else:
            ping = None

        if 'timeout' in kwargs:
            timeout = kwargs.get('timeout')
            del kwargs['timeout']
        else:
            timeout = None

        if ping or timeout:
            self.set_pings(ping, timeout)

        kwargs['_lazy'] = True
        Connection.__init__(self, *args, **kwargs)
        if pupy_srv:
            self._local_root.pupy_srv = pupy_srv
    def __init__(self, lock, pupy_srv, *args, **kwargs):
        self._sync_events = {}
        self._connection_serve_lock = lock
        self._last_recv = time.time()
        self._ping = False
        self._ping_timeout = 2
        self._serve_timeout = 10

        if 'ping' in kwargs:
            ping = kwargs.get('ping')
            del kwargs['ping']
        else:
            ping = None

        if 'timeout' in kwargs:
            timeout = kwargs.get('timeout')
            del kwargs['timeout']
        else:
            timeout = None

        if ping or timeout:
            self.set_pings(ping, timeout)

        kwargs['_lazy'] = True
        Connection.__init__(self, *args, **kwargs)
        if pupy_srv:
            self._local_root.pupy_srv = pupy_srv
Beispiel #3
0
 def __init__(self, lock, pupy_srv, *args, **kwargs):
     self._sync_events = {}
     self._connection_serve_lock = lock
     self._last_recv = time.time()
     kwargs['_lazy'] = True
     Connection.__init__(self, *args, **kwargs)
     if pupy_srv:
         self._local_root.pupy_srv = pupy_srv
Beispiel #4
0
    def __init__(self, pupy_srv, *args, **kwargs):
        self._close_lock = Lock()
        self._sync_events_lock = Lock()
        self._async_events_lock = Lock()

        self._sync_events = {}
        self._sync_raw_replies = {}
        self._sync_raw_exceptions = {}

        self._last_recv = time.time()
        self._ping = False
        self._ping_timeout = 30
        self._serve_timeout = 10
        self._last_ping = None
        self._default_serve_timeout = 5
        self._queue = SyncRequestDispatchQueue.get_queue()

        self._timer_event = None
        self._timer_event_last = None

        if 'ping' in kwargs:
            ping = kwargs.pop('ping')
        else:
            ping = None

        if 'timeout' in kwargs:
            timeout = kwargs.pop('timeout')
        else:
            timeout = None

        if 'timer_event' in kwargs:
            self._timer_event = kwargs.pop('timer_event')

        if ping or timeout:
            self.set_pings(ping, timeout)

        kwargs['_lazy'] = True
        Connection.__init__(self, *args, **kwargs)
        if pupy_srv:
            self._local_root.pupy_srv = pupy_srv

        if 'config' in kwargs:
            self._config.update(kwargs['config'])

        next(self._seqcounter)

        logger.debug('New PupyConnection: (%s)', self)
Beispiel #5
0
 def __init__(self, lock, *args, **kwargs):
     self._sync_events = {}
     self._connection_serve_lock = lock
     self._last_recv = time.time()
     Connection.__init__(self, *args, **kwargs)
Beispiel #6
0
 def __init__(self, lock, *args, **kwargs):
     self._sync_events = {}
     self._connection_serve_lock = lock
     self._last_recv = time.time()
     Connection.__init__(self, *args, **kwargs)