Skip to content

Conversation

jonhoo
Copy link
Contributor

@jonhoo jonhoo commented Sep 30, 2018

The previous implementation used a futures_cpupool for executing blocking juniper operations. This pool comes in addition to the thread pool started by hyper through tokio for executing hyper's futures. This patch uses tokio::blocking to perform the blocking juniper operations while re-using the same thread pool as hyper, which simplifies the API.

The previous implementation used a futures_cpupool for executing
blocking juniper operations. This pool comes in addition to the
thread pool started by hyper through tokio for executing hyper's futures.
This patch uses tokio::blocking to perform the blocking juniper
operations while re-using the same thread pool as hyper, which
simplifies the API.
@LegNeato
Copy link
Member

Cool, thanks for the PR! 🍻

I bet this is why we needed to use reqwest to solve the deadlocks in Travis...the futures cpupool and the hyper-handled pool would starve / deadlock each other on machines with few cores.

The warp integration likely needs similar changes as it uses futures_cpupool as well. That is out of scope for this PR though.

@LegNeato LegNeato merged commit ec963a6 into graphql-rust:master Sep 30, 2018
LegNeato added a commit to LegNeato/juniper that referenced this pull request Sep 30, 2018
LegNeato added a commit that referenced this pull request Sep 30, 2018
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