Channel

reactify.Channel
See theChannel companion object
class Channel[T] extends Reactive[T], Mutable[T]

Channel is a stateless Reactive implementation exposing a public method to fire values.

Type parameters

T

the type of value this Reactive receives

Attributes

Companion
object
Graph
Supertypes
trait Mutable[T]
trait Reactive[T]
class Object
trait Matchable
class Any
Known subtypes
class ChannelGroup[T]
class Trigger

Members list

Value members

Concrete methods

def &(that: Channel[T]): Channel[T]

Group multiple channels together

Group multiple channels together

Attributes

def and(that: Channel[T]): Channel[T]

Group multiple channels together

Group multiple channels together

Attributes

def collect[R](f: PartialFunction[T, R]): Channel[R]

Functional collection of this Channel into another Channel. All values received by this Channel will be collected and forwarded to the new Channel if they are collected by the conversion function.

Functional collection of this Channel into another Channel. All values received by this Channel will be collected and forwarded to the new Channel if they are collected by the conversion function.

Type parameters

R

the type of the Channel

Value parameters

f

conversion partial function

Attributes

Returns

Channel[R]

def map[R](f: T => R): Channel[R]

Functional mapping of this Channel into another Channel. All values received by this Channel will be mapped and forwarded to the new Channel.

Functional mapping of this Channel into another Channel. All values received by this Channel will be mapped and forwarded to the new Channel.

Type parameters

R

the type of the new Channel

Value parameters

f

conversion function

Attributes

Returns

Channel[R]

override def set(f: => T): Unit

Sets the function evaluation representing the new value for this mutable entity

Sets the function evaluation representing the new value for this mutable entity

Attributes

Definition Classes

Inherited methods

def !(future: Future[T])(implicit ec: ExecutionContext): Future[Unit]

Convenience functionality to assign the result of a future (upon completion) to this Channel

Convenience functionality to assign the result of a future (upon completion) to this Channel

Attributes

Inherited from:
Mutable
def :=(f: => T): Unit

Convenience alternative to "set"

Convenience alternative to "set"

Attributes

Inherited from:
Mutable
def @=(f: T): Unit

Convenience alternative to "static"

Convenience alternative to "static"

Attributes

Inherited from:
Mutable
def attach(f: T => Unit, priority: Double = ...): Reaction[T]

Convenience method to create a Reaction to attach to this Reactive

Convenience method to create a Reaction to attach to this Reactive

Value parameters

f

the function reaction

priority

the priority in comparison to other reactions (Defaults to Priority.Normal)

Attributes

Returns

created Reaction[T]

Inherited from:
Reactive
def changes(f: (T, T) => Unit, priority: Double = ...): Reaction[T]

Convenience method to create a Reaction to monitor changes to this Reactive

Convenience method to create a Reaction to monitor changes to this Reactive

Value parameters

f

the function reaction to receive changes

priority

the priority in comparison to other reactions (Defaults to Priority.Normal)

Attributes

Returns

created Reaction[T]

Inherited from:
Reactive
def future(condition: T => Boolean = ...): Future[T]

Convenience method to create a Future[T] that will complete upon the next reaction that meets to supplied condition.

Convenience method to create a Future[T] that will complete upon the next reaction that meets to supplied condition.

Value parameters

condition

optional condition that must be true for this to fire (Defaults to accept anything)

Attributes

Returns

Future[T]

Inherited from:
Reactive
def on(f: => Unit, priority: Double = ...): Reaction[T]

Convenience method to create a Reaction to monitor changes to this Reactive when you don't care about the actual value.

Convenience method to create a Reaction to monitor changes to this Reactive when you don't care about the actual value.

Value parameters

f

the function reaction to invoke in reaction to a value received

priority

the priority in comparison to other reactions (Defaults to Priority.Normal)

Attributes

Returns

created Reaction[T]

Inherited from:
Reactive
def once(f: T => Unit, condition: T => Boolean = ..., priority: Double = ...): Reaction[T]

Convenience method to create a Reaction to monitor a single reaction based on an optional condition.

Convenience method to create a Reaction to monitor a single reaction based on an optional condition.

Value parameters

condition

optional condition that must be true for this to fire (Defaults to accept anything)

f

the function reaction

priority

the priority in comparison to other reactions (Defaults to Priority.Normal)

Attributes

Returns

created Reaction[T]

Inherited from:
Reactive
def static(f: T): Unit

Sets a static value representing the new value for this mutable entity

Sets a static value representing the new value for this mutable entity

Attributes

Inherited from:
Mutable
def status: Option[ReactionStatus]

If the current thread is reacting to a value currently, status represents the status of the reaction. This can be set to ReactionStatus.Stop in order to stop propagation. This can also be achieved via stopPropagation().

If the current thread is reacting to a value currently, status represents the status of the reaction. This can be set to ReactionStatus.Stop in order to stop propagation. This can also be achieved via stopPropagation().

Attributes

Inherited from:
Reactive
def status_=(status: ReactionStatus): Unit

Attributes

Inherited from:
Reactive
def stopPropagation(): Unit

Shortcut functionality to call status = ReactionStatus.Stop

Shortcut functionality to call status = ReactionStatus.Stop

Attributes

Inherited from:
Reactive
def update(f: => T): Unit

Convenience alternative to "set"

Convenience alternative to "set"

Attributes

Inherited from:
Mutable

Inherited fields

lazy val reactions: Reactions[T]

Reactions currently associated with this Reactive

Reactions currently associated with this Reactive

Attributes

Inherited from:
Reactive