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

sse adapter approach #50

Merged
merged 17 commits into from
Jan 31, 2016
Merged

sse adapter approach #50

merged 17 commits into from
Jan 31, 2016

Conversation

kristofsajdak
Copy link
Contributor

This PR refactors the Mongodb specific SSE code into an adapter : adapterSSE. This adapter can be configured with options independent from the regular adapter to tweak settings such as maxPoolSize etc

I also took the opportunity to align the connection handling approach between normal db and oplog operations, and clean up the way the plugin integrates this into it's lifecycle

if (!models[hhSchema.type]) {

// clean up existing models and schemas
delete mongoose.models[hhSchema.type]
delete mongoose.modelSchemas[hhSchema.type]
//delete db.models[hhSchema.type]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why we had to delete them and no longer have to?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed the commented code in a new commit
the commit message describes why we no longer need this :

removed commented obsoleted code as we no longer have risk of clashes during tests
nowadays we allocate connections with mongoose.createConnection rather than mongoose.connect
models and schemas are scoped to a specific db object and are cleared out and reinstantiated on every test run

… during tests

nowadays we allocate connections with mongoose.createConnection rather than mongoose.connect

models and schemas are scoped to a specific db object and are cleared out and reinstantiated on every test run
# Conflicts:
#	lib/plugin.js
#	lib/sse.js
# Conflicts:
#	lib/plugin.js
#	lib/sse.js
…the app developer to specify the options

mongodb adapter and adaptersse :
had to go back to an approach using vars
the whole adapter connect concept needs to be refactored to properly support an immutable approach
mavdi added a commit that referenced this pull request Jan 31, 2016
@mavdi mavdi merged commit 36ff218 into develop Jan 31, 2016
@mavdi mavdi deleted the feature/sse-adapter-approach branch January 31, 2016 22:48
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