Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instances are reused if same kwargs are used. #77

Merged
merged 2 commits into from
Nov 17, 2016

Conversation

argaen
Copy link
Member

@argaen argaen commented Nov 17, 2016

Using a singleton-like pattern, instances are reused if same kwargs are passed
this means connections are also reused. It also introduces a pattern that
if an instance is changed, other ones will also be changed but this is wanted
because once initialized instances must behave as readonly

Save pool instances in RedisBackend and reuse them in case same args are used.

Closes #45
Closes #76

Using a singleton-like pattern, instances are reused if same kwargs are passed
this means connections are also reused. It also introduces a pattern that
if an instance is changed, other ones will also be changed but this is wanted
because once initialized instances must behave as readonly
If a pool is called with the same args as a previous one,
it will be reused
@argaen argaen force-pushed the enhancement_#45/reuse_class_instances branch from 0c5ae39 to 26643f1 Compare November 17, 2016 19:20
@codecov-io
Copy link

Current coverage is 100% (diff: 100%)

Merging #77 into master will not change coverage

@@           master   #77   diff @@
===================================
  Files          11    11          
  Lines         485   488     +3   
  Methods         0     0          
  Messages        0     0          
  Branches        0     0          
===================================
+ Hits          485   488     +3   
  Misses          0     0          
  Partials        0     0          

Powered by Codecov. Last update 6f0640d...26643f1

@argaen argaen merged commit cf68100 into master Nov 17, 2016
@argaen argaen deleted the enhancement_#45/reuse_class_instances branch November 17, 2016 19:29
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants