Skip to content

Commit

Permalink
Allow configurable pool size
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Dozor committed Nov 30, 2016
1 parent cf259e6 commit f16cac4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ batch.events = [SessionStartEvent(), app_event, SessionEndEvent()]
configuration = mparticle.Configuration()
configuration.api_key = 'REPLACE WITH API KEY'
configuration.api_secret = 'REPLACE WITH API SECRET'

# Raise the connection pool size if necessary (defaults to 1)
# configuration.connection_pool_size = 50

api_instance = mparticle.EventsApi(configuration)

# synchronous
Expand Down
2 changes: 2 additions & 0 deletions mparticle/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ def __init__(self):
self.cert_file = None
# client key file
self.key_file = None
# number of simultaneous connection to maintain
self.connection_pool_size = 1

@property
def logger_file(self):
Expand Down
3 changes: 2 additions & 1 deletion mparticle/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ def __init__(self, pools_size=4, config=None):
cert_reqs=cert_reqs,
ca_certs=ca_certs,
cert_file=cert_file,
key_file=key_file
key_file=key_file,
maxsize=config.connection_pool_size
)

def request(self, method, url, query_params=None, headers=None,
Expand Down

0 comments on commit f16cac4

Please sign in to comment.