-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement incoming grain call filters for observers (#9054)
- Loading branch information
1 parent
6ff7edc
commit a44d4a3
Showing
12 changed files
with
556 additions
and
77 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
101 changes: 67 additions & 34 deletions
101
src/Orleans.Core/Core/ClientBuilderGrainCallFilterExtensions.cs
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,42 +1,75 @@ | ||
namespace Orleans.Hosting | ||
namespace Orleans.Hosting; | ||
|
||
/// <summary> | ||
/// Extensions for configuring grain call filters. | ||
/// </summary> | ||
public static class ClientBuilderGrainCallFilterExtensions | ||
{ | ||
/// <summary> | ||
/// Extensions for configuring grain call filters. | ||
/// Adds an <see cref="IIncomingGrainCallFilter"/> to the filter pipeline. | ||
/// </summary> | ||
/// <param name="builder">The builder.</param> | ||
/// <param name="filter">The filter.</param> | ||
/// <returns>The builder.</returns> | ||
public static IClientBuilder AddIncomingGrainCallFilter(this IClientBuilder builder, IIncomingGrainCallFilter filter) | ||
{ | ||
return builder.ConfigureServices(services => services.AddIncomingGrainCallFilter(filter)); | ||
} | ||
|
||
/// <summary> | ||
/// Adds an <see cref="IIncomingGrainCallFilter"/> to the filter pipeline. | ||
/// </summary> | ||
/// <typeparam name="TImplementation">The filter implementation type.</typeparam> | ||
/// <param name="builder">The builder.</param> | ||
/// <returns>The builder.</returns> | ||
public static IClientBuilder AddIncomingGrainCallFilter<TImplementation>(this IClientBuilder builder) | ||
where TImplementation : class, IIncomingGrainCallFilter | ||
{ | ||
return builder.ConfigureServices(services => services.AddIncomingGrainCallFilter<TImplementation>()); | ||
} | ||
|
||
/// <summary> | ||
/// Adds an <see cref="IIncomingGrainCallFilter"/> to the filter pipeline via a delegate. | ||
/// </summary> | ||
/// <param name="builder">The builder.</param> | ||
/// <param name="filter">The filter.</param> | ||
/// <returns>The builder.</returns> | ||
public static IClientBuilder AddIncomingGrainCallFilter(this IClientBuilder builder, IncomingGrainCallFilterDelegate filter) | ||
{ | ||
return builder.ConfigureServices(services => services.AddIncomingGrainCallFilter(filter)); | ||
} | ||
|
||
/// <summary> | ||
/// Adds an <see cref="IOutgoingGrainCallFilter"/> to the filter pipeline. | ||
/// </summary> | ||
public static class ClientBuilderGrainCallFilterExtensions | ||
/// <param name="builder">The builder.</param> | ||
/// <param name="filter">The filter.</param> | ||
/// <returns>The <see cref="IClientBuilder"/>.</returns> | ||
public static IClientBuilder AddOutgoingGrainCallFilter(this IClientBuilder builder, IOutgoingGrainCallFilter filter) | ||
{ | ||
/// <summary> | ||
/// Adds an <see cref="IOutgoingGrainCallFilter"/> to the filter pipeline. | ||
/// </summary> | ||
/// <param name="builder">The builder.</param> | ||
/// <param name="filter">The filter.</param> | ||
/// <returns>The <see cref="IClientBuilder"/>.</returns> | ||
public static IClientBuilder AddOutgoingGrainCallFilter(this IClientBuilder builder, IOutgoingGrainCallFilter filter) | ||
{ | ||
return builder.ConfigureServices(services => services.AddOutgoingGrainCallFilter(filter)); | ||
} | ||
return builder.ConfigureServices(services => services.AddOutgoingGrainCallFilter(filter)); | ||
} | ||
|
||
/// <summary> | ||
/// Adds an <see cref="IOutgoingGrainCallFilter"/> to the filter pipeline. | ||
/// </summary> | ||
/// <typeparam name="TImplementation">The filter implementation type.</typeparam> | ||
/// <param name="builder">The builder.</param> | ||
/// <returns>The <see cref="IClientBuilder"/>.</returns> | ||
public static IClientBuilder AddOutgoingGrainCallFilter<TImplementation>(this IClientBuilder builder) | ||
where TImplementation : class, IOutgoingGrainCallFilter | ||
{ | ||
return builder.ConfigureServices(services => services.AddOutgoingGrainCallFilter<TImplementation>()); | ||
} | ||
/// <summary> | ||
/// Adds an <see cref="IOutgoingGrainCallFilter"/> to the filter pipeline. | ||
/// </summary> | ||
/// <typeparam name="TImplementation">The filter implementation type.</typeparam> | ||
/// <param name="builder">The builder.</param> | ||
/// <returns>The <see cref="IClientBuilder"/>.</returns> | ||
public static IClientBuilder AddOutgoingGrainCallFilter<TImplementation>(this IClientBuilder builder) | ||
where TImplementation : class, IOutgoingGrainCallFilter | ||
{ | ||
return builder.ConfigureServices(services => services.AddOutgoingGrainCallFilter<TImplementation>()); | ||
} | ||
|
||
/// <summary> | ||
/// Adds an <see cref="IOutgoingGrainCallFilter"/> to the filter pipeline via a delegate. | ||
/// </summary> | ||
/// <param name="builder">The builder.</param> | ||
/// <param name="filter">The filter.</param> | ||
/// <returns>The <see cref="IClientBuilder"/>.</returns> | ||
public static IClientBuilder AddOutgoingGrainCallFilter(this IClientBuilder builder, OutgoingGrainCallFilterDelegate filter) | ||
{ | ||
return builder.ConfigureServices(services => services.AddOutgoingGrainCallFilter(filter)); | ||
} | ||
/// <summary> | ||
/// Adds an <see cref="IOutgoingGrainCallFilter"/> to the filter pipeline via a delegate. | ||
/// </summary> | ||
/// <param name="builder">The builder.</param> | ||
/// <param name="filter">The filter.</param> | ||
/// <returns>The <see cref="IClientBuilder"/>.</returns> | ||
public static IClientBuilder AddOutgoingGrainCallFilter(this IClientBuilder builder, OutgoingGrainCallFilterDelegate filter) | ||
{ | ||
return builder.ConfigureServices(services => services.AddOutgoingGrainCallFilter(filter)); | ||
} | ||
} |
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
File renamed without changes.
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
Oops, something went wrong.