Trait

io.dylemma.frp

EventJoin

Related Doc: package frp

Permalink

trait EventJoin[A, B, C] extends EventSource[C]

An EventJoin is a transformer that takes in events of type A and B from two parent EventStreams and produces any number of new events of type C in response.

To create an EventJoin, implement the three required methods:

protected def leftParent: EventStream[A]
protected def rightParent: EventStream[B]
protected def handle(event: Either[Event[A], Event[B]]): Boolean

Generally, handle will call fire and/or stop. **Note:** to see the method signatures in this documentation, make sure to select "Visibility: All".

Linear Supertypes
EventSource[C], EventSourceImpl[C], EventStream[C], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. EventJoin
  2. EventSource
  3. EventSourceImpl
  4. EventStream
  5. AnyRef
  6. Any
Implicitly
  1. by EventStreamFutures
  2. by any2stringadd
  3. by StringFormat
  4. by Ensuring
  5. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def handle(event: Either[Event[A], Event[B]]): Boolean

    Permalink

    The method that reacts to events from the two parent streams.

    The method that reacts to events from the two parent streams. Generally, the body of this method will include calls to fire or stop, depending on the received event.

    **Note:** if both parents are stopped, this method will be ignored, and this EventJoin will automatically become stopped as well.

    event

    An event sent from one of the two parent streams. Events from the leftParent will be wrapped in a Left, while events from the rightParent will be wrapped in a Right.

    returns

    Whether or not to keep the handle method attached to the parent stream that sent the event. Returning true will maintain the attachment. Returning false will cause the corresponding parent to detach the handle.

    Attributes
    protected
  2. abstract def leftParent: EventStream[A]

    Permalink

    The "left" parent EventStream.

    The "left" parent EventStream. Events from this stream will be passed into the handle method, wrapped in a scala.util.Left.

    Attributes
    protected
  3. abstract def rightParent: EventStream[B]

    Permalink

    The "right" parent EventStream.

    The "right" parent EventStream. Events from this stream will be passed into the handle method, wrapped in a scala.util.Right.

    Attributes
    protected

Concrete Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Implicit information
    This member is added by an implicit conversion from EventJoin[A, B, C] to any2stringadd[EventJoin[A, B, C]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ++[A1 >: C](that: EventStream[A1]): EventStream[A1]

    Permalink
    Definition Classes
    EventSourceImpl
  5. def ->[B](y: B): (EventJoin[A, B, C], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from EventJoin[A, B, C] to ArrowAssoc[EventJoin[A, B, C]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  6. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  7. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  8. def before(deadline: Deadline): EventStream[C]

    Permalink
    Definition Classes
    EventSourceImpl
  9. def clear(): Unit

    Permalink
    Definition Classes
    EventSourceEventStream
  10. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def collect[B](pf: PartialFunction[C, B]): EventStream[B]

    Permalink
    Definition Classes
    EventSourceImpl
  12. def drop(count: Int): EventStream[C]

    Permalink
    Definition Classes
    EventSourceImpl
  13. def dropWhile(p: (C) ⇒ Boolean): EventStream[C]

    Permalink
    Definition Classes
    EventSourceImpl
  14. def either[B](that: EventStream[B]): EventStream[Either[C, B]]

    Permalink
    Definition Classes
    EventSourceImpl
  15. def end[T](implicit obs: Observer, time: Time[T]): Future[T]

    Permalink

    Returns a Future that will complete when this stream stops.

    Returns a Future that will complete when this stream stops. The resulting value will be a rough estimate (System.currentTimeMillis) of when the stream ended. If the stream never ends, the resulting Future will never complete.

    returns

    A Future containing a time stamp describing when this stream stopped.

    Implicit information
    This member is added by an implicit conversion from EventJoin[A, B, C] to EventStreamFutures[C] performed by method EventStreamFutures in io.dylemma.frp.
    Definition Classes
    EventStreamFutures
  16. def ensuring(cond: (EventJoin[A, B, C]) ⇒ Boolean, msg: ⇒ Any): EventJoin[A, B, C]

    Permalink
    Implicit information
    This member is added by an implicit conversion from EventJoin[A, B, C] to Ensuring[EventJoin[A, B, C]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  17. def ensuring(cond: (EventJoin[A, B, C]) ⇒ Boolean): EventJoin[A, B, C]

    Permalink
    Implicit information
    This member is added by an implicit conversion from EventJoin[A, B, C] to Ensuring[EventJoin[A, B, C]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  18. def ensuring(cond: Boolean, msg: ⇒ Any): EventJoin[A, B, C]

    Permalink
    Implicit information
    This member is added by an implicit conversion from EventJoin[A, B, C] to Ensuring[EventJoin[A, B, C]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  19. def ensuring(cond: Boolean): EventJoin[A, B, C]

    Permalink
    Implicit information
    This member is added by an implicit conversion from EventJoin[A, B, C] to Ensuring[EventJoin[A, B, C]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  20. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  22. def filter(p: (C) ⇒ Boolean): EventStream[C]

    Permalink
    Definition Classes
    EventSourceImpl
  23. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  24. def fire(event: C): Unit

    Permalink
    Definition Classes
    EventSource
  25. def flatMap[B](f: (C) ⇒ EventStream[B]): EventStream[B]

    Permalink
    Definition Classes
    EventSourceImpl
  26. def foldLeft[B](z: B)(op: (B, C) ⇒ B): EventStream[B]

    Permalink
    Definition Classes
    EventSourceImpl
  27. def foreach[U](f: (C) ⇒ U)(implicit obs: Observer): Unit

    Permalink

    Attach an event handler for data fired by this stream.

    Attach an event handler for data fired by this stream.

    f

    A function that takes in an event data and performs side effects.

    Definition Classes
    EventStream
  28. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from EventJoin[A, B, C] to StringFormat[EventJoin[A, B, C]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  29. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  30. def grouped(size: Int): EventStream[List[C]]

    Permalink
    Definition Classes
    EventSourceImpl
  31. def hashCode(): Int

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

    Permalink
    Definition Classes
    Any
  33. def last(implicit obs: Observer): Future[C]

    Permalink

    Returns a Future that will complete with the value of the last event fired by this stream.

    Returns a Future that will complete with the value of the last event fired by this stream. If the stream is stopped or becomes stopped before firing an event, the Future will fail with a NoSuchElementException.

    returns

    A Future containing the last event fired by this stream.

    Implicit information
    This member is added by an implicit conversion from EventJoin[A, B, C] to EventStreamFutures[C] performed by method EventStreamFutures in io.dylemma.frp.
    Definition Classes
    EventStreamFutures
  34. lazy val leftHandlerFunc: (Event[A]) ⇒ Boolean

    Permalink

    This is needed so that the respective closure is not garbage-collected.

    This is needed so that the respective closure is not garbage-collected.

    Attributes
    protected
  35. def map[B](f: (C) ⇒ B): EventStream[B]

    Permalink
    Definition Classes
    EventSourceImpl
  36. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  37. def next(implicit obs: Observer): Future[C]

    Permalink

    Returns a Future that will complete with the value of the next event fired by this stream.

    Returns a Future that will complete with the value of the next event fired by this stream. If the stream is stopped, or if it stops before firing an event, the Future will fail with a NoSuchElementException.

    returns

    A Future containing the next event fired by this stream.

    Implicit information
    This member is added by an implicit conversion from EventJoin[A, B, C] to EventStreamFutures[C] performed by method EventStreamFutures in io.dylemma.frp.
    Definition Classes
    EventStreamFutures
  38. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  39. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  40. def onEnd(f: ⇒ Unit)(implicit obs: Observer): Unit

    Permalink

    Assign a block of code that will run when this stream stops.

    Assign a block of code that will run when this stream stops. If this stream is already stopped, the block of code will run immediately.

    f

    A block of code that will run when this stream sends a Stop event.

    Definition Classes
    EventStream
  41. def onNext(f: (C) ⇒ Unit)(implicit obs: Observer): Unit

    Permalink

    Assign a handler for the next event fired by this stream.

    Assign a handler for the next event fired by this stream.

    f

    A function that takes in an event data and performs side effects. It can be assumed that f will be run at most once.

    Definition Classes
    EventStream
  42. def parentsStopped: Boolean

    Permalink

    Checks whether both parent streams are stopped.

    Checks whether both parent streams are stopped.

    returns

    true if and only if both the leftParent and rightParent streams are stopped.

  43. def produce(item: Event[C]): Unit

    Permalink

    Produce a new item.

    Produce a new item. All handler functions will be called with item as the argument. There is no guarantee of the order in which the handler functions will be called.

    item

    The item to be sent to all handlers (sinks).

    Attributes
    protected
    Definition Classes
    EventSource
  44. def purgeThreshold: Int

    Permalink

    A number indicating the minimum number of cleared references that must be encountered before purging all cleared references from the list.

    A number indicating the minimum number of cleared references that must be encountered before purging all cleared references from the list. This method may be overridden - the default value is 5.

    Attributes
    protected
    Definition Classes
    EventSource
  45. lazy val rightHandlerFunc: (Event[B]) ⇒ Boolean

    Permalink

    This is needed so that the respective closure is not garbage-collected.

    This is needed so that the respective closure is not garbage-collected.

    Attributes
    protected
  46. def sink(handler: (Event[C]) ⇒ Boolean)(implicit obs: Observer): Unit

    Permalink

    Add a handler function that acts as a sink for items produced by this Source.

    Add a handler function that acts as a sink for items produced by this Source. The handler is expected to return true as long as it remains active. Once the handler function returns false in response to some produced item, it will be deactivated and will no longer receive new items. There is no guarantee of the order that handlers will be called.

    handler

    The handler function to receive items produced by this Source. Once the handler returns false in response to some produced item, it will be deactivated and will no longer receive new items.

    obs

    An implicit Observer which is required in order to properly manage references between this Source and any handlers, avoiding reference loops.

    Definition Classes
    EventStream
  47. def stop(): Unit

    Permalink
    Definition Classes
    EventSource
  48. def stopped: Boolean

    Permalink

    Marks whether or not this stream is stopped.

    Marks whether or not this stream is stopped. A stopped stream will not produce any more events.

    returns

    true if this stream is stopped, false otherwise.

    Definition Classes
    EventSourceEventStream
  49. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  50. def take(count: Int): EventStream[C]

    Permalink
    Definition Classes
    EventSourceImpl
  51. def takeWhile(p: (C) ⇒ Boolean): EventStream[C]

    Permalink
    Definition Classes
    EventSourceImpl
  52. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  53. def until(end: EventStream[_]): EventStream[C]

    Permalink
    Definition Classes
    EventSourceImpl
  54. def unzip[A1, A2](implicit asPair: (C) ⇒ (A1, A2)): (EventStream[A1], EventStream[A2])

    Permalink
    Definition Classes
    EventSourceImpl
  55. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  58. def withFilter(p: (C) ⇒ Boolean): EventStream[C]

    Permalink
    Definition Classes
    EventSourceImpl
  59. def within(duration: Duration): EventStream[C]

    Permalink
    Definition Classes
    EventSourceImpl
  60. def zip[B](that: EventStream[B]): EventStream[(C, B)]

    Permalink
    Definition Classes
    EventSourceImpl
  61. def zipWithIndex: EventStream[(C, Int)]

    Permalink
    Definition Classes
    EventSourceImpl
  62. def zipWithStaleness: EventStream[(C, () ⇒ Boolean)]

    Permalink
    Definition Classes
    EventSourceImpl
  63. def zipWithTime[T](implicit arg0: Time[T]): EventStream[(C, T)]

    Permalink
    Definition Classes
    EventSourceImpl
  64. def ||[A1 >: C](that: EventStream[A1]): EventStream[A1]

    Permalink
    Definition Classes
    EventSourceImpl
  65. def [B](y: B): (EventJoin[A, B, C], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from EventJoin[A, B, C] to ArrowAssoc[EventJoin[A, B, C]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from EventSource[C]

Inherited from EventSourceImpl[C]

Inherited from EventStream[C]

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion EventStreamFutures from EventJoin[A, B, C] to EventStreamFutures[C]

Inherited by implicit conversion any2stringadd from EventJoin[A, B, C] to any2stringadd[EventJoin[A, B, C]]

Inherited by implicit conversion StringFormat from EventJoin[A, B, C] to StringFormat[EventJoin[A, B, C]]

Inherited by implicit conversion Ensuring from EventJoin[A, B, C] to Ensuring[EventJoin[A, B, C]]

Inherited by implicit conversion ArrowAssoc from EventJoin[A, B, C] to ArrowAssoc[EventJoin[A, B, C]]

Ungrouped