Example #1
0
File: pool.py Project: cenk/inbox
 def __init__(self, account_id, num_connections=5):
     log.info('Creating connection pool for account {0} with {1}\
         connections'.format(account_id, num_connections))
     self.account_id = account_id
     self._set_account_info()
     # 1200s == 20min
     ConnectionPool.__init__(self, num_connections, keepalive=1200)
Example #2
0
 def __init__(self, account_id, num_connections, readonly):
     log.info('Creating Crispin connection pool for account {} with {} '
              'connections'.format(account_id, num_connections))
     self.account_id = account_id
     self.readonly = readonly
     self._set_account_info()
     # 1200s == 20min
     ConnectionPool.__init__(self, num_connections, keepalive=1200)
Example #3
0
    def __init__(self, account_id, num_connections, debug=False):
        self.log = get_logger(account_id, 'sendmail: connection_pool')
        self.log.info('Creating SMTP connection pool for account {0} with {1} '
                      'connections'.format(account_id, num_connections))

        self.account_id = account_id
        self._set_account_info()

        self.debug = debug

        # 1200s == 20min
        ConnectionPool.__init__(self, num_connections, keepalive=1200)
Example #4
0
    def __init__(self, account_id, num_connections=5, debug=False):
        self.log = get_logger(account_id, 'sendmail: connection_pool')
        self.log.info('Creating SMTP connection pool for account {0} with {1} '
                      'connections'.format(account_id, num_connections))

        self.account_id = account_id
        self._set_account_info()

        self.debug = debug

        self.auth_handlers = {'OAuth': self.smtp_oauth,
                              'Password': self.smtp_password}

        # 1200s == 20min
        ConnectionPool.__init__(self, num_connections, keepalive=1200)
Example #5
0
 def __init__(self, service, region='us-east-1'):
     ConnectionPool.__init__(self, 10)
     self.service = service
     self.region = region
Example #6
0
 def __init__(self, pool_size, server, version, redis_timeout):
     ConnectionPool.__init__(self, pool_size, keepalive=redis_timeout/2)
     self.server = server
     self.version = version
Example #7
0
 def __init__(self, pool_size, server, max_max_query_time, socket_timeout):
     ConnectionPool.__init__(self, pool_size, keepalive=socket_timeout/2)
     self.server = server
     self.max_max_query_time = max_max_query_time
     self.socket_timeout = socket_timeout
Example #8
0
 def __init__(self, service, region='us-east-1'):
     ConnectionPool.__init__(self, 10)
     self.service = service
     self.region = region