-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: simplify Eval trait (#2207)
- Loading branch information
Showing
13 changed files
with
224 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,12 @@ | ||
use core::future::Future; | ||
use std::pin::Pin; | ||
use std::future::Future; | ||
|
||
use super::{EvaluationContext, EvaluationError, ResolverContextLike}; | ||
|
||
pub trait Eval<Output = async_graphql::Value> | ||
where | ||
Self: Send + Sync, | ||
{ | ||
fn eval<'a, Ctx: ResolverContextLike<'a> + Sync + Send>( | ||
&'a self, | ||
ctx: EvaluationContext<'a, Ctx>, | ||
) -> Pin<Box<dyn Future<Output = Result<Output, EvaluationError>> + 'a + Send>> | ||
pub trait Eval<Output = async_graphql::Value> { | ||
fn eval<Ctx>( | ||
&self, | ||
ctx: &mut EvaluationContext<'_, Ctx>, | ||
) -> impl Future<Output = Result<Output, EvaluationError>> | ||
where | ||
Output: 'a; | ||
Ctx: ResolverContextLike + Sync; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
6e89264
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running 30s test @ http://localhost:8000/graphql
4 threads and 100 connections
457498 requests in 30.10s, 2.29GB read
Requests/sec: 15199.42
Transfer/sec: 78.01MB