forked from microsoft/reverse-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement ProxyConfig and ProxyConfigProvider callbacks
Fix microsoft#1619
- Loading branch information
Showing
5 changed files
with
329 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
using System; | ||
|
||
namespace Yarp.ReverseProxy.Configuration; | ||
|
||
/// <summary> | ||
/// Represents an optional configuration capability. When decorating a <see cref="IProxyConfig"/> type, | ||
/// will allow config instances to be notified upon config applying. | ||
/// </summary> | ||
public interface IProxyConfigNotifier | ||
{ | ||
/// <summary> | ||
/// A callback that will be triggered once changes to the configuration have been successfully applied. | ||
/// </summary> | ||
void SuccessfulConfigChangeApplyingCallback(); | ||
|
||
/// <summary> | ||
/// A callback that will be triggered once changes to the configuration have been tried to be applied but eventually failed. | ||
/// </summary> | ||
void ErroredConfigChangeApplyingCallback(Exception ex); | ||
} |
23 changes: 23 additions & 0 deletions
23
src/ReverseProxy/Configuration/IProxyConfigProviderNotifier.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
using System; | ||
|
||
namespace Yarp.ReverseProxy.Configuration; | ||
|
||
/// <summary> | ||
/// Represents an optional configuration provider capability. When decorating a <see cref="IProxyConfigProvider"/> type, | ||
/// will allow config provider instances to be notified upon config loading. | ||
/// </summary> | ||
public interface IProxyConfigProviderNotifier | ||
{ | ||
/// <summary> | ||
/// A callback that will be triggered once the configuration have been successfully loaded. | ||
/// </summary> | ||
void SuccessfulConfigLoadingCallback(); | ||
|
||
/// <summary> | ||
/// A callback that will be triggered once the configuration have been tried to be loaded but eventually failed. | ||
/// </summary> | ||
void ErroredConfigLoadingCallback(Exception ex); | ||
} |
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.