Click or drag to resize
Akka.NETSwitch Class
An atomic switch that can be either on or off
Inheritance Hierarchy
SystemObject
  Akka.UtilSwitch

Namespace:  Akka.Util
Assembly:  Akka (in Akka.dll) Version: 1.2.3.42 (1.2.3.42)
Syntax
public class Switch

The Switch type exposes the following members.

Constructors
  NameDescription
Public methodSwitch
TBD
Top
Properties
  NameDescription
Public propertyIsOff
Gets a value indicating whether this switch is off. No locking.
Public propertyIsOn
Gets a value indicating whether this switch is on. No locking.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIfOff
Executes the provided action and returns if the action was executed or not, if the switch is IMMEDIATELY off (i.e. no lock involved)
Public methodIfOn
Executes the provided action and returns if the action was executed or not, if the switch is IMMEDIATELY on (i.e. no lock involved)
Public methodLocked
TBD
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodSwitchOff
Switches the switch off (if on). Uses locking.
Public methodSwitchOff(Action)
Executes the provided action if the lock is on. This is done under a lock so be _very_ careful with longrunning/blocking operations in it. Only executes the action if the switch is on, and switches it off immediately after obtaining the lock. Will switch it back on if the provided action throws an exception.
Public methodSwitchOn
Switches the switch on (if off). Uses locking.
Public methodSwitchOn(Action)
Executes the provided action if the lock is off. This is done under a lock so be _very_ careful with longrunning/blocking operations in it. Only executes the action if the switch is off, and switches it on immediately after obtaining the lock. Will switch it back off if the provided action throws an exception.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Protected methodTranscendFrom
TBD
Public methodWhileOff
Executes the provided action and returns if the action was executed or not, if the switch is off, waiting for any pending changes to happen before (locking) Be careful of longrunning or blocking within the provided action as it can lead to deadlocks or bad performance
Public methodWhileOn
Executes the provided action and returns if the action was executed or not, if the switch is on, waiting for any pending changes to happen before (locking) Be careful of longrunning or blocking within the provided action as it can lead to deadlocks or bad performance
Top
Extension Methods
See Also