-
-
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
12 changed files
with
109 additions
and
34 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,3 @@ | ||
namespace Sample.Contracts; | ||
|
||
public record TickerRequest(int Repeat, int Multiplier, int GapSeconds) : IStreamRequest<string>; |
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 Sample.Contracts; | ||
|
||
namespace Sample.Handlers; | ||
|
||
|
||
[RegisterHandler] | ||
public class TickerStreamRequestHandler : IStreamRequestHandler<TickerRequest, string> | ||
{ | ||
public async IAsyncEnumerable<string> Handle(TickerRequest request, CancellationToken cancellationToken) | ||
{ | ||
for (var i = 0; i < request.Repeat; i++) | ||
{ | ||
await Task.Delay(TimeSpan.FromSeconds(request.GapSeconds)); | ||
var value = i * request.Multiplier; | ||
yield return ($"{i} : {value}"); | ||
} | ||
} | ||
} |
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
9 changes: 0 additions & 9 deletions
9
src/Shiny.Mediator.Maui/Middleware/ConnectivityStreamRequestMiddleware.cs
This file was deleted.
Oops, something went wrong.
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,7 +1,7 @@ | ||
// namespace Shiny.Mediator; | ||
// | ||
// | ||
// public interface IStreamRequestHandler<in TRequest, TResult> where TRequest : IStreamRequest<TResult> | ||
// { | ||
// IAsyncEnumerable<TResult> Handle(TRequest request, CancellationToken cancellationToken); | ||
// } | ||
namespace Shiny.Mediator; | ||
|
||
|
||
public interface IStreamRequestHandler<in TRequest, TResult> where TRequest : IStreamRequest<TResult> | ||
{ | ||
IAsyncEnumerable<TResult> Handle(TRequest request, CancellationToken cancellationToken); | ||
} |
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