ListenerLock

gears.async.Listener.ListenerLock
trait ListenerLock

A lock required by a listener to be acquired before accepting values. Should there be multiple listeners that needs to be locked at the same time, they should be locked by larger-number-first.

Some implementations are provided for ease of implementations:

  • For custom listener implementations involving locks: NumberedLock provides uniquely numbered locks.
  • For source transformation implementations: withLock is a convenient .map for [[ListenerLock]] | Null.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def acquire(): Boolean

Attempt to lock the current ListenerLock. Locks are guaranteed to be held as short as possible.

Attempt to lock the current ListenerLock. Locks are guaranteed to be held as short as possible.

Attributes

def release(): Unit

Release the current lock.

Release the current lock.

Attributes

Abstract fields

val selfNumber: Long

The assigned number of the lock. It is required that listeners that can be locked together to have different numbers. This requirement can be simply done by using a lock created using NumberedLock.

The assigned number of the lock. It is required that listeners that can be locked together to have different numbers. This requirement can be simply done by using a lock created using NumberedLock.

Attributes