-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(server,connector): add test code for acknowledgements
- Loading branch information
1 parent
86fb3c5
commit d72eb2f
Showing
2 changed files
with
28 additions
and
0 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
18 changes: 18 additions & 0 deletions
18
...cture.Relay.Server.Docker/Interceptors/ConnectorFinishedAcknowledgementModeInterceptor.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,18 @@ | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Thinktecture.Relay.Acknowledgement; | ||
using Thinktecture.Relay.Server.Interceptor; | ||
using Thinktecture.Relay.Server.Transport; | ||
using Thinktecture.Relay.Transport; | ||
|
||
namespace Thinktecture.Relay.Server.Docker.Interceptors; | ||
|
||
public class ConnectorFinishedAcknowledgementModeInterceptor : IClientRequestInterceptor<ClientRequest, TargetResponse> | ||
{ | ||
public Task OnRequestReceivedAsync(IRelayContext<ClientRequest, TargetResponse> context, | ||
CancellationToken cancellationToken = default) | ||
{ | ||
context.ClientRequest.AcknowledgeMode = AcknowledgeMode.Manual; | ||
return Task.CompletedTask; | ||
} | ||
} |