Trait/Object

io.dylemma.frp

EventSource

Related Docs: object EventSource | package frp

Permalink

trait EventSource[A] extends EventStream[A] with EventSourceImpl[A]

EventSource is an implementation of EventStream that adds fire and stop methods. Usage in client code will generally look something like

class CoolThings {
	private val _events = EventSource[Thing]

	// don't expose `fire` and `stop` publicly: EventStream is read-only
	def events: EventStream[Thing] = _events

	def doThings = { events fire new Thing(...) }
}
Linear Supertypes
EventSourceImpl[A], EventStream[A], AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. EventSource
  2. EventSourceImpl
  3. EventStream
  4. AnyRef
  5. 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

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 EventSource[A] to any2stringadd[EventSource[A]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ++[A1 >: A](that: EventStream[A1]): EventStream[A1]

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

    Permalink
    Implicit information
    This member is added by an implicit conversion from EventSource[A] to ArrowAssoc[EventSource[A]] 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[A]

    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[A, B]): EventStream[B]

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

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

    Permalink
    Definition Classes
    EventSourceImpl
  14. def either[B](that: EventStream[B]): EventStream[Either[A, 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 EventSource[A] to EventStreamFutures[A] performed by method EventStreamFutures in io.dylemma.frp.
    Definition Classes
    EventStreamFutures
  16. def ensuring(cond: (EventSource[A]) ⇒ Boolean, msg: ⇒ Any): EventSource[A]

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

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

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

    Permalink
    Implicit information
    This member is added by an implicit conversion from EventSource[A] to Ensuring[EventSource[A]] 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: (A) ⇒ Boolean): EventStream[A]

    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: A): Unit

    Permalink
  25. def flatMap[B](f: (A) ⇒ EventStream[B]): EventStream[B]

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

    Permalink
    Definition Classes
    EventSourceImpl
  27. def foreach[U](f: (A) ⇒ 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 EventSource[A] to StringFormat[EventSource[A]] 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[A]]

    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[A]

    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 EventSource[A] to EventStreamFutures[A] performed by method EventStreamFutures in io.dylemma.frp.
    Definition Classes
    EventStreamFutures
  34. def map[B](f: (A) ⇒ B): EventStream[B]

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

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

    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 EventSource[A] to EventStreamFutures[A] performed by method EventStreamFutures in io.dylemma.frp.
    Definition Classes
    EventStreamFutures
  37. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  39. 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
  40. def onNext(f: (A) ⇒ 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
  41. def produce(item: Event[A]): 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
  42. 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
  43. def sink(handler: (Event[A]) ⇒ 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
  44. def stop(): Unit

    Permalink
  45. 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
  46. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  47. def take(count: Int): EventStream[A]

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

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    EventSourceImpl
  56. def within(duration: Duration): EventStream[A]

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

    Permalink
    Definition Classes
    EventSourceImpl
  58. def zipWithIndex: EventStream[(A, Int)]

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

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

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

    Permalink
    Definition Classes
    EventSourceImpl
  62. def [B](y: B): (EventSource[A], B)

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

Inherited from EventSourceImpl[A]

Inherited from EventStream[A]

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion EventStreamFutures from EventSource[A] to EventStreamFutures[A]

Inherited by implicit conversion any2stringadd from EventSource[A] to any2stringadd[EventSource[A]]

Inherited by implicit conversion StringFormat from EventSource[A] to StringFormat[EventSource[A]]

Inherited by implicit conversion Ensuring from EventSource[A] to Ensuring[EventSource[A]]

Inherited by implicit conversion ArrowAssoc from EventSource[A] to ArrowAssoc[EventSource[A]]

Ungrouped