scala.reactive

Isolate

trait Isolate[T] extends ReactRecord

An isolated, independent event propagation context.

An Isolate[T] object accepts events of type T on its input channel. One isolate can propagate events concurrently to other isolates -- it is a basic element of concurrency. Reactive values cannot be shared between isolates -- it is an error to use a reactive value originating in one isolate in some different isolate.

Isolates are defined by extending the Isolate trait. The events passed to isolates can be subscribed to using their source reactive. Here is an example:

class MyPrinter extends Isolate[String] {
react <<= source onEvent {
  e => println(e)
}
}

Separate isolate instances that exist at runtime are created using isolate systems. The isolate method in the isolate system requires a scheduler to execute the isolate. Here is an example:

import Scheduler.Implicits.globalExecutionContext
val isolateSystem = IsolateSystem.default("MyIsolateSystem")
val channel = isolateSystem.isolate(Proto[MyPrinter])

Creating an isolate returns its channel. Reactives can be attached to channels to propagate their events to isolates.

val emitter = new Reactive.Emitter[String]
channel.attach(emitter)
emitter += "Hi!" // eventually, this is printed by `MyPrinter`

To stop an isolate, its channel needs to be sealed, and all the previously attached reactives need to be closed.

emitter.close()
channel.seal()

Isolates also receive special SysEvents on the sysEvents reactive. If a subscription on the source reactive throws a non-fatal exception, the exception is emitted on the failures reactive.

T

the type of the events this isolate produces

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Isolate
  2. ReactRecord
  3. ReactMutable
  4. AnyRef
  5. Any
Implicitly
  1. by any2stringadd
  2. by any2stringfmt
  3. by any2ArrowAssoc
  4. by any2Ensuring
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def +(other: String): String

    Implicit information
    This member is added by an implicit conversion from Isolate[T] to StringAdd performed by method any2stringadd in scala.Predef.
    Definition Classes
    StringAdd
  5. def ->[B](y: B): (Isolate[T], B)

    Implicit information
    This member is added by an implicit conversion from Isolate[T] to ArrowAssoc[Isolate[T]] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  6. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  7. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def bindSubscription(s: Subscription): Subscription

    Called internally - binds a subscription to this reactive mutable value.

    Called internally - binds a subscription to this reactive mutable value.

    Definition Classes
    ReactMutable
  10. final def channel: Channel[T]

  11. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. def ensuring(cond: (Isolate[T]) ⇒ Boolean, msg: ⇒ Any): Isolate[T]

    Implicit information
    This member is added by an implicit conversion from Isolate[T] to Ensuring[Isolate[T]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. def ensuring(cond: (Isolate[T]) ⇒ Boolean): Isolate[T]

    Implicit information
    This member is added by an implicit conversion from Isolate[T] to Ensuring[Isolate[T]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. def ensuring(cond: Boolean, msg: ⇒ Any): Isolate[T]

    Implicit information
    This member is added by an implicit conversion from Isolate[T] to Ensuring[Isolate[T]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  15. def ensuring(cond: Boolean): Isolate[T]

    Implicit information
    This member is added by an implicit conversion from Isolate[T] to Ensuring[Isolate[T]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  16. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  17. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  18. final def failures: Reactive[Throwable]

  19. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. def formatted(fmtstr: String): String

    Implicit information
    This member is added by an implicit conversion from Isolate[T] to StringFormat performed by method any2stringfmt in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  21. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  22. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  23. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  24. def later: Enqueuer[T]

  25. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  26. final def notify(): Unit

    Definition Classes
    AnyRef
  27. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  28. def onMutated(): Unit

    Called internally - when the mutable reactive or its internal value has been mutated.

    Called internally - when the mutable reactive or its internal value has been mutated.

    Definition Classes
    ReactRecordReactMutable
  29. object react

    Definition Classes
    ReactRecord
  30. object recorded

    Definition Classes
    ReactRecord
  31. final def source: Reactive[T]

  32. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  33. final def sysEvents: Reactive[SysEvent]

  34. final def system: IsolateSystem

  35. def toString(): String

    Definition Classes
    AnyRef → Any
  36. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. def [B](y: B): (Isolate[T], B)

    Implicit information
    This member is added by an implicit conversion from Isolate[T] to ArrowAssoc[Isolate[T]] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Shadowed Implicit Value Members

  1. val self: Any

    Implicit information
    This member is added by an implicit conversion from Isolate[T] to StringAdd performed by method any2stringadd in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (isolate: StringAdd).self
    Definition Classes
    StringAdd
  2. val self: Any

    Implicit information
    This member is added by an implicit conversion from Isolate[T] to StringFormat performed by method any2stringfmt in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (isolate: StringFormat).self
    Definition Classes
    StringFormat

Deprecated Value Members

  1. def x: Isolate[T]

    Implicit information
    This member is added by an implicit conversion from Isolate[T] to ArrowAssoc[Isolate[T]] performed by method any2ArrowAssoc in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (isolate: ArrowAssoc[Isolate[T]]).x
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use leftOfArrow instead

  2. def x: Isolate[T]

    Implicit information
    This member is added by an implicit conversion from Isolate[T] to Ensuring[Isolate[T]] performed by method any2Ensuring in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (isolate: Ensuring[Isolate[T]]).x
    Definition Classes
    Ensuring
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use resultOfEnsuring instead

Inherited from container.ReactRecord

Inherited from ReactMutable

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from Isolate[T] to StringAdd

Inherited by implicit conversion any2stringfmt from Isolate[T] to StringFormat

Inherited by implicit conversion any2ArrowAssoc from Isolate[T] to ArrowAssoc[Isolate[T]]

Inherited by implicit conversion any2Ensuring from Isolate[T] to Ensuring[Isolate[T]]

Ungrouped