1 instantiation of Circuit
Microsoft.AspNetCore.Components.Server (1)
Circuits\CircuitHost.cs (1)
71Circuit = 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> 46public 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> 58public virtual Task OnConnectionUpAsync(Circuit circuit, CancellationToken cancellationToken) => Task.CompletedTask; 63/// <param name="circuit">The <see cref="Circuit"/>.</param> 66public virtual Task OnConnectionDownAsync(Circuit circuit, CancellationToken cancellationToken) => Task.CompletedTask; 71/// <param name="circuit">The <see cref="Circuit"/>.</param> 74public virtual Task OnCircuitClosedAsync(Circuit circuit, CancellationToken cancellationToken) => Task.CompletedTask;
Circuits\CircuitHost.cs (2)
89public Circuit Circuit { get; } 631private 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. 16public Circuit Circuit { get; } 18internal CircuitInboundActivityContext(Func<Task> handler, Circuit circuit)
Circuits\DefaultCircuitAccessor.cs (1)
8public Circuit Circuit { get; set; }
Circuits\ICircuitAccessor.cs (1)
8Circuit 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)
99handler.Verify(v => v.OnCircuitOpenedAsync(It.IsAny<Circuit>(), It.IsAny<CancellationToken>()), Times.Never()); 100handler.Verify(v => v.OnConnectionUpAsync(It.IsAny<Circuit>(), It.IsAny<CancellationToken>()), Times.Once()); 101handler.Verify(v => v.OnConnectionDownAsync(It.IsAny<Circuit>(), It.IsAny<CancellationToken>()), Times.Never()); 102handler.Verify(v => v.OnCircuitClosedAsync(It.IsAny<Circuit>(), It.IsAny<CancellationToken>()), Times.Never()); 123handler.Verify(v => v.OnCircuitOpenedAsync(It.IsAny<Circuit>(), It.IsAny<CancellationToken>()), Times.Never()); 124handler.Verify(v => v.OnConnectionUpAsync(It.IsAny<Circuit>(), It.IsAny<CancellationToken>()), Times.Once()); 125handler.Verify(v => v.OnConnectionDownAsync(It.IsAny<Circuit>(), It.IsAny<CancellationToken>()), Times.Once()); 126handler.Verify(v => v.OnCircuitClosedAsync(It.IsAny<Circuit>(), It.IsAny<CancellationToken>()), Times.Never()); 136handler.Setup(h => h.OnConnectionUpAsync(It.IsAny<Circuit>(), It.IsAny<CancellationToken>())).Throws(new InvalidTimeZoneException()); 182handler.Verify(v => v.OnCircuitOpenedAsync(It.IsAny<Circuit>(), It.IsAny<CancellationToken>()), Times.Never()); 183handler.Verify(v => v.OnConnectionUpAsync(It.IsAny<Circuit>(), It.IsAny<CancellationToken>()), Times.Never()); 184handler.Verify(v => v.OnConnectionDownAsync(It.IsAny<Circuit>(), It.IsAny<CancellationToken>()), Times.Once()); 185handler.Verify(v => v.OnCircuitClosedAsync(It.IsAny<Circuit>(), It.IsAny<CancellationToken>()), Times.Never()); 201handler.Verify(v => v.OnCircuitOpenedAsync(It.IsAny<Circuit>(), It.IsAny<CancellationToken>()), Times.Never()); 202handler.Verify(v => v.OnConnectionUpAsync(It.IsAny<Circuit>(), It.IsAny<CancellationToken>()), Times.Never()); 203handler.Verify(v => v.OnConnectionDownAsync(It.IsAny<Circuit>(), It.IsAny<CancellationToken>()), Times.Never()); 204handler.Verify(v => v.OnCircuitClosedAsync(It.IsAny<Circuit>(), It.IsAny<CancellationToken>()), Times.Never()); 219handler.Verify(v => v.OnCircuitOpenedAsync(It.IsAny<Circuit>(), It.IsAny<CancellationToken>()), Times.Never()); 220handler.Verify(v => v.OnConnectionUpAsync(It.IsAny<Circuit>(), It.IsAny<CancellationToken>()), Times.Never()); 221handler.Verify(v => v.OnConnectionDownAsync(It.IsAny<Circuit>(), It.IsAny<CancellationToken>()), Times.Never()); 222handler.Verify(v => v.OnCircuitClosedAsync(It.IsAny<Circuit>(), It.IsAny<CancellationToken>()), Times.Never());