Suspension
An abstraction that represents a general suspension point within a process. Suspensions are one-shot. That is, once resumed they cannot be used again unless passed through the suspend(suspension: Suspension) function for a KSLProcess.
To be useful, a suspension must be used as an argument of the suspend(suspension: Suspension) function for a KSLProcess. The main purpose of this class is to better facilitate process interaction coordination between entities that must suspend and resume each other to try to make the interaction less error-prone.
Parameters
the name of the suspension. Useful for debugging and tracking of suspensions. Defaults to null. If null, a useful name is created based on its identity.
the type of suspension. By default, this is the general type, SuspendType.SUSPEND.
Properties
True when resume() would wake the process waiting on this suspension: a process is suspended on it, it has not already been resumed, and the replication's events have not ended. False otherwise, when resume() either fails (nothing waits on it, it was already resumed, or the replication's events have ended, as in replicationEnded()) or does nothing (its process was terminated at it, or the replication's entities are being terminated). Check it before resuming.
True indicates that the entity's process ended at this suspension point by some path other than resumption, so nothing is waiting on the suspension any more. Distinct from isResumed, which means the wait completed normally, and distinct from a suspension that has never been used. Resuming an abandoned suspension is not an error; it is dropped and logged. The flag is cleared when the suspension is used again.
A suspension is once only. Once done it cannot be reused. This flag indicates if the suspension has occurred and been resumed. True means that the resumption has occurred. False means that the resumption has not yet occurred. This flag is set to false internally by the suspend(suspension: Suspension) function when the suspension is used. Once the suspension has been resumed, this property remains true, unless the suspension is passed again through the suspend(suspension: Suspension) function
True indicates that the suspension is suspending for the associated entity.