-
Notifications
You must be signed in to change notification settings - Fork 117
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
Add support of a custom executor #67
base: master
Are you sure you want to change the base?
Conversation
@PvdBerg1998, could you please test this branch with your executor? |
Looks great! I'll test it now. |
I have a question: what happens when the |
The same concern I have about this function: Line 39 in 7a978e6
Also, this still is hardcoded to use tokio. Edit: I think the disconnection should just be done in a blocking way inside Drop. |
I found something weird: my process does not exit after
|
I found the issue: I have a wrapping type around a let _ = block_on(self.pool.clone().disconnect().compat()); Apparently this blocks forever when the executor is halted. Any idea how this could be prevented? |
@blackbeam I would really like to fix this issue. Just fyi the PR most likely breaks something (or, hopefully, I'm doing something wrong) so it shouldn't be merged yet. If we wait until async await is stable and tokio is updated, I can move back to using tokio and this is no longer an issue. Still it is a nice flexibility feature but I expect tokio to get used most of the time |
This PR adds support of a custom executors (defaults to
tokio::executor::DefaultExecutor
).Required bounds for supported executors are defined as
MyExecutor
trait.New constructors:
Conn::with_executor
Conn::from_url_with_executor
Pool::with_executor
Pool::from_url_with_executor
Changes to existing code should be minimal because of default value for new type parameter on
Pool
andConn
.