-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
211 additions
and
144 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Shiny.Mediator.Maui.Services; | ||
|
||
namespace Shiny.Mediator.Middleware; | ||
|
||
public class CacheHandlers(CacheManager cacheManager) : IRequestHandler<FlushAllCacheRequest>, IRequestHandler<FlushCacheItemRequest> | ||
{ | ||
public Task Handle(FlushAllCacheRequest request, CancellationToken cancellationToken) | ||
{ | ||
cacheManager.FlushAllCache(); | ||
return Task.CompletedTask; | ||
} | ||
|
||
public Task Handle(FlushCacheItemRequest request, CancellationToken cancellationToken) | ||
{ | ||
cacheManager.RemoveCacheItem(request.Request); | ||
return Task.CompletedTask; | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
namespace Shiny.Mediator; | ||
|
||
public record FlushAllCacheRequest : IRequest; | ||
public record FlushCacheItemRequest(object Request) : IRequest; |
Oops, something went wrong.