A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/graphql-dotnet/parser/commit/fab469157eb5464a29b03cc01ed61d077d093a34 below:

Remove ThrowIfCancellationRequested from VisitAsync (#337) · graphql-dotnet/parser@fab4691 · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+3

-3

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+3

-3

lines changed Original file line number Diff line number Diff line change

@@ -33,12 +33,13 @@ public void ASTVisitor_Should_Throw_On_Unknown_Node()

33 33

}

34 34 35 35

[Fact]

36 -

public void ASTVisitor_Should_Respect_CancellationToken()

36 +

public void ASTVisitor_Should_Pass_CancellationToken()

37 37

{

38 38

var document = "scalar JSON".Parse();

39 39

var visitor = new MyVisitor();

40 40

using var cts = new CancellationTokenSource(500);

41 41

var context = new Context { CancellationToken = cts.Token };

42 +

context.CancellationToken.ThrowIfCancellationRequested();

42 43 43 44

Should.Throw<OperationCanceledException>(() => visitor.VisitAsync(document, context).GetAwaiter().GetResult());

44 45

}

@@ -48,6 +49,7 @@ private class MyVisitor : ASTVisitor<Context>

48 49

protected override async ValueTask VisitScalarTypeDefinitionAsync(GraphQLScalarTypeDefinition scalarTypeDefinition, Context context)

49 50

{

50 51

await Task.Delay(700);

52 +

context.CancellationToken.ThrowIfCancellationRequested();

51 53

await base.VisitScalarTypeDefinitionAsync(scalarTypeDefinition, context);

52 54

}

53 55

}

Original file line number Diff line number Diff line change

@@ -595,8 +595,6 @@ protected virtual async ValueTask VisitInputObjectTypeExtensionAsync(GraphQLInpu

595 595

/// <param name="context">Context passed into all INodeVisitor.VisitXXX methods.</param>

596 596

public virtual ValueTask VisitAsync(ASTNode? node, TContext context)

597 597

{

598 -

context.CancellationToken.ThrowIfCancellationRequested();

599 - 600 598

return node == null

601 599

? default

602 600

: node switch

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4