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

Integrate db layer and handlers w/ a Middleware/Extractor #65

Closed
pjenvey opened this issue Oct 16, 2018 · 0 comments · Fixed by #77
Closed

Integrate db layer and handlers w/ a Middleware/Extractor #65

pjenvey opened this issue Oct 16, 2018 · 0 comments · Fixed by #77
Assignees
Labels
enhancement New feature or request

Comments

@pjenvey
Copy link
Member

pjenvey commented Oct 16, 2018

The Handlers should be provided a Db instance created from the pool (probably from an extractor). An associated middleware will ensure an appropriate transaction + lock is established and committed (or rolled back) at the end of the request

@pjenvey pjenvey added the enhancement New feature or request label Oct 16, 2018
@pjenvey pjenvey self-assigned this Oct 16, 2018
pjenvey added a commit that referenced this issue Oct 24, 2018
adds a transaction/collection lock middleware + a Db extractor

tokio_threadpool::blocking won't work under actix, so:

- manage our own ThreadPool, satisfying our async interface via cloning the
MysqlDb before sending it over to the ThreadPool
- unfortunately requires wrapping the inner state in Arc (and RefCell for the
mutable parts) and an accompanying unsafe Send and

Issue #65
pjenvey added a commit that referenced this issue Oct 26, 2018
- kills get_collection_id (only used within the db layer now)
- simplify uid_data! (just alias HawkIdentifier)
- phrasing

Issue #65
pjenvey added a commit that referenced this issue Oct 31, 2018
- get/post_collection -> get/post_bsos
- fix the ownership todo in post_bsos
- fix get_collection_modified's handling of empty sets
- add clone to Box<dyn Db> for sharing Dbs among handlers & req.extensions
w/out an Rc
- have the pool run migrations and fix an unwrap() in run_embedded_migrations

Closes #65
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant