1 instantiation of Circuit
Microsoft.AspNetCore.Components.Server (1)
Circuits\CircuitHost.cs (1)
71
Circuit = new
Circuit
(this);
55 references to Circuit
Microsoft.AspNetCore.Components.Server (24)
Circuits\Circuit.cs (1)
19
/// Gets the identifier for the <see cref="
Circuit
"/>.
Circuits\CircuitHandler.cs (15)
7
/// A <see cref="CircuitHandler"/> allows running code during specific lifetime events of a <see cref="
Circuit
"/>.
10
/// <see cref="OnCircuitOpenedAsync(
Circuit
, CancellationToken)"/> is invoked after an initial circuit to the client
14
/// <see cref="OnConnectionUpAsync(
Circuit
, CancellationToken)"/> is invoked immediately after the completion of
15
/// <see cref="OnCircuitOpenedAsync(
Circuit
, CancellationToken)"/>. In addition, the method is invoked each time a connection is re-established
16
/// with a client after it's been dropped. <see cref="OnConnectionDownAsync(
Circuit
, CancellationToken)"/> is invoked each time a connection
20
/// <see cref="OnCircuitClosedAsync(
Circuit
, CancellationToken)"/> is invoked prior to the server evicting the circuit to the client.
43
/// <param name="circuit">The <see cref="
Circuit
"/>.</param>
46
public virtual Task OnCircuitOpenedAsync(
Circuit
circuit, CancellationToken cancellationToken) => Task.CompletedTask;
51
/// This method is executed once initially after <see cref="OnCircuitOpenedAsync(
Circuit
, CancellationToken)"/>
55
/// <param name="circuit">The <see cref="
Circuit
"/>.</param>
58
public virtual Task OnConnectionUpAsync(
Circuit
circuit, CancellationToken cancellationToken) => Task.CompletedTask;
63
/// <param name="circuit">The <see cref="
Circuit
"/>.</param>
66
public virtual Task OnConnectionDownAsync(
Circuit
circuit, CancellationToken cancellationToken) => Task.CompletedTask;
71
/// <param name="circuit">The <see cref="
Circuit
"/>.</param>
74
public virtual Task OnCircuitClosedAsync(
Circuit
circuit, CancellationToken cancellationToken) => Task.CompletedTask;
Circuits\CircuitHost.cs (2)
89
public
Circuit
Circuit { get; }
631
private static Func<Func<Task>, Task> BuildInboundActivityDispatcher(IReadOnlyList<CircuitHandler> circuitHandlers,
Circuit
circuit)
Circuits\CircuitInboundActivityContext.cs (4)
7
/// Contains information about inbound <see cref="Circuits.
Circuit
"/> activity.
14
/// Gets the <see cref="Circuits.
Circuit
"/> associated with the activity.
16
public
Circuit
Circuit { get; }
18
internal CircuitInboundActivityContext(Func<Task> handler,
Circuit
circuit)
Circuits\DefaultCircuitAccessor.cs (1)
8
public
Circuit
Circuit { get; set; }
Circuits\ICircuitAccessor.cs (1)
8
Circuit
Circuit { get; }
Microsoft.AspNetCore.Components.Server.Tests (31)
Circuits\CircuitHostTest.cs (10)
76
.Setup(h => h.OnCircuitClosedAsync(It.IsAny<
Circuit
>(), It.IsAny<CancellationToken>()))
171
.Setup(h => h.OnCircuitOpenedAsync(It.IsAny<
Circuit
>(), cancellationToken))
177
.Setup(h => h.OnCircuitOpenedAsync(It.IsAny<
Circuit
>(), cancellationToken))
183
.Setup(h => h.OnConnectionUpAsync(It.IsAny<
Circuit
>(), cancellationToken))
189
.Setup(h => h.OnConnectionUpAsync(It.IsAny<
Circuit
>(), cancellationToken))
257
.Setup(h => h.OnCircuitOpenedAsync(It.IsAny<
Circuit
>(), It.IsAny<CancellationToken>()))
302
.Setup(h => h.OnConnectionDownAsync(It.IsAny<
Circuit
>(), cancellationToken))
308
.Setup(h => h.OnConnectionDownAsync(It.IsAny<
Circuit
>(), cancellationToken))
314
.Setup(h => h.OnCircuitClosedAsync(It.IsAny<
Circuit
>(), cancellationToken))
320
.Setup(h => h.OnCircuitClosedAsync(It.IsAny<
Circuit
>(), cancellationToken))
Circuits\CircuitRegistryTest.cs (21)
99
handler.Verify(v => v.OnCircuitOpenedAsync(It.IsAny<
Circuit
>(), It.IsAny<CancellationToken>()), Times.Never());
100
handler.Verify(v => v.OnConnectionUpAsync(It.IsAny<
Circuit
>(), It.IsAny<CancellationToken>()), Times.Once());
101
handler.Verify(v => v.OnConnectionDownAsync(It.IsAny<
Circuit
>(), It.IsAny<CancellationToken>()), Times.Never());
102
handler.Verify(v => v.OnCircuitClosedAsync(It.IsAny<
Circuit
>(), It.IsAny<CancellationToken>()), Times.Never());
123
handler.Verify(v => v.OnCircuitOpenedAsync(It.IsAny<
Circuit
>(), It.IsAny<CancellationToken>()), Times.Never());
124
handler.Verify(v => v.OnConnectionUpAsync(It.IsAny<
Circuit
>(), It.IsAny<CancellationToken>()), Times.Once());
125
handler.Verify(v => v.OnConnectionDownAsync(It.IsAny<
Circuit
>(), It.IsAny<CancellationToken>()), Times.Once());
126
handler.Verify(v => v.OnCircuitClosedAsync(It.IsAny<
Circuit
>(), It.IsAny<CancellationToken>()), Times.Never());
136
handler.Setup(h => h.OnConnectionUpAsync(It.IsAny<
Circuit
>(), It.IsAny<CancellationToken>())).Throws(new InvalidTimeZoneException());
182
handler.Verify(v => v.OnCircuitOpenedAsync(It.IsAny<
Circuit
>(), It.IsAny<CancellationToken>()), Times.Never());
183
handler.Verify(v => v.OnConnectionUpAsync(It.IsAny<
Circuit
>(), It.IsAny<CancellationToken>()), Times.Never());
184
handler.Verify(v => v.OnConnectionDownAsync(It.IsAny<
Circuit
>(), It.IsAny<CancellationToken>()), Times.Once());
185
handler.Verify(v => v.OnCircuitClosedAsync(It.IsAny<
Circuit
>(), It.IsAny<CancellationToken>()), Times.Never());
201
handler.Verify(v => v.OnCircuitOpenedAsync(It.IsAny<
Circuit
>(), It.IsAny<CancellationToken>()), Times.Never());
202
handler.Verify(v => v.OnConnectionUpAsync(It.IsAny<
Circuit
>(), It.IsAny<CancellationToken>()), Times.Never());
203
handler.Verify(v => v.OnConnectionDownAsync(It.IsAny<
Circuit
>(), It.IsAny<CancellationToken>()), Times.Never());
204
handler.Verify(v => v.OnCircuitClosedAsync(It.IsAny<
Circuit
>(), It.IsAny<CancellationToken>()), Times.Never());
219
handler.Verify(v => v.OnCircuitOpenedAsync(It.IsAny<
Circuit
>(), It.IsAny<CancellationToken>()), Times.Never());
220
handler.Verify(v => v.OnConnectionUpAsync(It.IsAny<
Circuit
>(), It.IsAny<CancellationToken>()), Times.Never());
221
handler.Verify(v => v.OnConnectionDownAsync(It.IsAny<
Circuit
>(), It.IsAny<CancellationToken>()), Times.Never());
222
handler.Verify(v => v.OnCircuitClosedAsync(It.IsAny<
Circuit
>(), It.IsAny<CancellationToken>()), Times.Never());