CircuitHandler Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
A CircuitHandler allows running code during specific lifetime events of a Circuit.
- OnCircuitOpenedAsync(Circuit, CancellationToken) is invoked after an initial circuit to the client has been established.
- OnConnectionUpAsync(Circuit, CancellationToken) is invoked immediately after the completion of OnCircuitOpenedAsync(Circuit, CancellationToken). In addition, the method is invoked each time a connection is re-established with a client after it's been dropped. OnConnectionDownAsync(Circuit, CancellationToken) is invoked each time a connection is dropped.
- OnCircuitClosedAsync(Circuit, CancellationToken) is invoked prior to the server evicting the circuit to the client. Application users may use this event to save state for a client that can be later rehydrated.
public ref class CircuitHandler abstract
public abstract class CircuitHandler
type CircuitHandler = class
Public MustInherit Class CircuitHandler
- Inheritance
-
CircuitHandler
Constructors
CircuitHandler() |
Properties
Order |
Gets the execution order for the current instance of CircuitHandler. When multiple CircuitHandler instances are registered, the Order property is used to determine the order in which instances are executed. When two handlers have the same value for Order, their execution order is non-deterministic. |
Methods
CreateInboundActivityHandler(Func<CircuitInboundActivityContext,Task>) |
Creates a handler that gets invoked when inbound activity on the circuit causes an asynchronous task to be dispatched on the server. |
OnCircuitClosedAsync(Circuit, CancellationToken) |
Invoked when a new circuit is being discarded. |
OnCircuitOpenedAsync(Circuit, CancellationToken) |
Invoked when a new circuit was established. |
OnConnectionDownAsync(Circuit, CancellationToken) |
Invoked when a connection to the client was dropped. |
OnConnectionUpAsync(Circuit, CancellationToken) |
Invoked when a connection to the client was established. This method is executed once initially after OnCircuitOpenedAsync(Circuit, CancellationToken) and once each for each reconnect during the lifetime of a circuit. |