Returns a Future
that will complete when this stream stop
s.
Returns a Future
that will complete when this stream stop
s. 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.
A Future
containing a time stamp describing when this stream stopped.
Attach an event handler for data fired by this stream.
Attach an event handler for data fired by this stream.
A function that takes in an event data and performs side effects.
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
.
A Future
containing the last event fired by this stream.
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
.
A Future
containing the next event fired by this stream.
Assign a block of code that will run when this stream stop
s.
Assign a block of code that will run when this stream stop
s. If this stream
is already stopped, the block of code will run immediately.
A block of code that will run when this stream sends a Stop
event.
Assign a handler for the next event fired by this stream.
Assign a handler for the next event fired by this stream.
A function that takes in an event data and performs side effects.
It can be assumed that f
will be run at most once.
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.
The item to be sent to all handler
s (sinks).
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.
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.
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.
An implicit Observer
which is required in order to properly
manage references between this Source
and any handler
s, avoiding
reference loops.
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.
true
if this stream is stopped, false
otherwise.
(eventSource: StringAdd).self
(eventSource: StringFormat).self
(eventSource: ArrowAssoc[EventSource[A]]).x
(Since version 2.10.0) Use leftOfArrow
instead
(eventSource: Ensuring[EventSource[A]]).x
(Since version 2.10.0) Use resultOfEnsuring
instead
EventSource is an implementation of EventStream that adds
fire
andstop
methods. Usage in client code will generally look something like