Listener

gears.async.Listener
See theListener companion trait
object Listener

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Listener.type

Members list

Type members

Classlikes

abstract case class ForwardingListener[T](src: Source[_], inner: Listener[_]) extends Listener[T]

A special class of listener that forwards the inner listener through the given source. For purposes of Async.Source.dropListener these listeners are compared for equality by the hash of the source and the inner listener.

A special class of listener that forwards the inner listener through the given source. For purposes of Async.Source.dropListener these listeners are compared for equality by the hash of the source and the inner listener.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Listener[T]
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
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.

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

Supertypes
class Object
trait Matchable
class Any
object NumberedLock

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
trait NumberedLock

A helper instance that provides an uniquely numbered mutex.

A helper instance that provides an uniquely numbered mutex.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

inline def acceptingListener[T](inline consumer: (T, Source[T]) => Unit): Listener[T]

A simple Listener that always accepts the item and sends it to the consumer.

A simple Listener that always accepts the item and sends it to the consumer.

Attributes

inline def apply[T](consumer: (T, Source[T]) => Unit): Listener[T]

Returns a simple Listener that always accepts the item and sends it to the consumer.

Returns a simple Listener that always accepts the item and sends it to the consumer.

Attributes

inline def withLock[T](listener: Listener[_])(inline body: ListenerLock => T): T | Null

Maps the lock of a listener, if it exists.

Maps the lock of a listener, if it exists.

Attributes