Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Condition ¶
type Condition struct {
// contains filtered or unexported fields
}
Condition could be used to wait for a synced change of something.
func (*Condition) Broadcast ¶
Broadcast broadcast trigger to the condition. If there are more then one listener, every of them will receive the trigger. This method is not blocking.
func (*Condition) Interrupt ¶
func (instance *Condition) Interrupt()
Interrupt interrupts every possible current running Wait() method of this instance. In this instance, nobody will be able to call Wait() from this moment on.
func (*Condition) Send ¶
Send sends ONE trigger to the condition. If there are more than one listener, only one of them will receive the trigger. This method is not a blocking method.
type Group ¶ added in v0.1.6
type Group struct {
// contains filtered or unexported fields
}
Group is a couple of tools (like sleep, locks, conditions, ...) that are grouped together and could be interrupted by calling Interrupt() method.
func (*Group) Interrupt ¶ added in v0.1.6
func (instance *Group) Interrupt()
Interrupt interrupts every action on this SyncGroup. After calling this method the instance is no longer usable anymore.
func (*Group) NewCondition ¶ added in v0.1.6
NewCondition creates a new condition in the current SyncGroup with the given Mutex.
type Interruptable ¶
type Interruptable interface {
Interrupt()
}
Interruptable represents an object that could be interrupted.
type InterruptedError ¶
type InterruptedError struct{}
InterruptedError occurs if someone has called the Interrupt() method.
func (InterruptedError) Error ¶
func (instance InterruptedError) Error() string
type Mutex ¶
type Mutex struct {
// contains filtered or unexported fields
}
Mutex is a lock in a SyncGroup.
func (*Mutex) Interrupt ¶
func (instance *Mutex) Interrupt()
Interrupt interrupts every possible current running Lock() and TryLock() method of this instance. In this instance, nobody will be able to call Lock() and TryLock() from this moment on.
func (*Mutex) Lock ¶
Lock locks the current thread to this mutex. If this is not possible an error will be returned. This method is blocking until locking is possible.
type TimeoutError ¶
type TimeoutError struct{}
TimeoutError occurs if a timeout condition is reached.
func (TimeoutError) Error ¶
func (instance TimeoutError) Error() string