Example #1
0
 def _pull_trigger(self, tryagain=10):
     try:
         self.trigger.pull_trigger()
     except OSError:
         self.trigger.close()
         self.trigger = trigger()
         if tryagain > 0:
             self._pull_trigger(tryagain=tryagain - 1)
Example #2
0
 def __init__(self, timeout):
     threading.Thread.__init__(self)
     self.setDaemon(1)
     self._timeout = timeout
     self._client = None
     self._deadline = None
     self._cond = threading.Condition()  # Protects _client and _deadline
     self._trigger = trigger()
Example #3
0
 def __init__(self, timeout):
     threading.Thread.__init__(self)
     self.setDaemon(1)
     self._timeout = timeout
     self._client = None
     self._deadline = None
     self._cond = threading.Condition() # Protects _client and _deadline
     self._trigger = trigger()
Example #4
0
 def _pull_trigger(self, tryagain=10):
     try:
         self.trigger.pull_trigger()
     except OSError:
         self.trigger.close()
         self.trigger = trigger()
         if tryagain > 0:
             self._pull_trigger(tryagain=tryagain-1)
Example #5
0
from ZEO.zrpc.trigger import trigger
from ZEO.zrpc.log import short_repr, log
from ZODB.loglevels import BLATHER, TRACE
import ZODB.POSException

REPLY = ".reply" # message name used for replies
ASYNC = 1

exception_type_type = type(Exception)

##############################################################################
# Dedicated Client select loop:
client_timeout = 30.0
client_timeout_count = 0 # for testing
client_map = {}
client_trigger = trigger(client_map)
client_logger = logging.getLogger('ZEO.zrpc.client_loop')
client_exit_event = threading.Event()
client_running = False
def client_exit():
    global client_running
    if client_running:
        client_running = False
        client_trigger.pull_trigger()
        client_exit_event.wait(99)

atexit.register(client_exit)

def client_loop():
    global client_running
    client_running = True
Example #6
0
 def set_async(self, map):
     self.trigger = trigger()
     self.thr_async = True
Example #7
0
from ZEO.zrpc.marshal import Marshaller
from ZEO.zrpc.trigger import trigger
from ZEO.zrpc.log import short_repr, log
from ZODB.loglevels import BLATHER, TRACE

REPLY = ".reply"  # message name used for replies
ASYNC = 1

exception_type_type = type(Exception)

##############################################################################
# Dedicated Client select loop:
client_timeout = 30.0
client_timeout_count = 0  # for testing
client_map = {}
client_trigger = trigger(client_map)
client_logger = logging.getLogger('ZEO.zrpc.client_loop')
client_exit_event = threading.Event()
client_running = True


def client_exit():
    global client_running
    client_running = False
    client_trigger.pull_trigger()
    client_exit_event.wait()


atexit.register(client_exit)

Example #8
0
 def set_async(self, map):
     self.trigger = trigger()
     self.thr_async = True