SignalR stream sample fix. Link to sample updated in related article. (#7237)
- Fixed sample for SignalR stream usage. - Link to this code sample updated as well, because of 404 error when opening it from aspnetcore/signalr/streaming.mdpull/7242/head
parent
abf707ed00
commit
2aa982e164
|
@ -24,7 +24,7 @@ A hub method automatically becomes a streaming hub method when it returns a `Cha
|
|||
> [!NOTE]
|
||||
> Write to the `ChannelReader` on a background thread and return the `ChannelReader` as soon as possible. Other hub invocations will be blocked until a `ChannelReader` is returned.
|
||||
|
||||
[!code-csharp[Streaming hub method](streaming/sample/hubs/streamhub.cs?range=10-34)]
|
||||
[!code-csharp[Streaming hub method](streaming/sample/Hubs/StreamHub.cs?range=10-34)]
|
||||
|
||||
## .NET client
|
||||
|
||||
|
@ -64,4 +64,4 @@ To end the stream from the client call the `dispose` method on the `ISubscriptio
|
|||
* [Hubs](xref:signalr/hubs)
|
||||
* [.NET client](xref:signalr/dotnet-client)
|
||||
* [JavaScript client](xref:signalr/javascript-client)
|
||||
* [Publish to Azure](xref:signalr/publish-to-azure-web-app)
|
||||
* [Publish to Azure](xref:signalr/publish-to-azure-web-app)
|
||||
|
|
|
@ -25,11 +25,11 @@ namespace SignalRChat.Hubs
|
|||
{
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
await channel.Writer.WriteAsync(i);
|
||||
await writer.WriteAsync(i);
|
||||
await Task.Delay(delay);
|
||||
}
|
||||
|
||||
channel.Writer.TryComplete();
|
||||
writer.TryComplete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue