Statement
is defined to enable processing of asynchronous resolvable
values such as cp.rx.Observable values.Statement
implementation, we use the Statement.named constructor. This gives us a Statement.Definition which allows us to set the rules for the statement before finally "defining" it.onInit
, and must have an onObservable
provided, and then the define
method must be called.Observable
as passed to the onInit
function handler as the second parameter. context
is always the first parameter, followed by any values passed to the constructor call.It is recommended that any conversion of input parameters are converted toObservable
s as late as possible, typically in theonObservable
function handler. Otherwise, input values may get resolved before the user intends.
cp.rx.go.Statement.defaultObserverFactory([factoryFn]) -> nil
Observer
for Statements which are executed without one being provided.Observer
, or the previous factory function if a new one was provided.Observer
instance.cp.rx.go.Statement.is(thing) -> boolean
thing
is a Statement
.true
if the thing is a Statement
.cp.rx.go.Statement.toObservable(thing[, params]) -> cp.rx.Observable
thing
into an Observable
. It converts the following:thing
if it's a function
.Observable
.cp.rx.go.Statement.toObservables(things[, params]) -> table
Observables
of those things.Observables
.function
things.Observable
.cp.rx.go.Statement.named(name) -> Statement.Definition
Statement
with the specified names.Statement
.cp.rx.go.Statement:After(millis[, observer][, scheduler]) -> nil
cp.rx.Scheduler
to use. Uses the cp.rx.util.defaultScheduler()
if none is provided.cp.rx.go.Statement:Catch(handler) -> cp.rx.go.Statement
Statement
.cp.rx.go.Statement:Debug([label]) -> Statement
Statement
should be output to the Error Log.Statement
instance.cp.rx.go.Statement:Finally(handler) -> Statement
onError
or onComplete
signal.Statement
instance.cp.rx.go.Statement:fullName()
cp.rx.go.Statement:Label(label) -> Statement
label
for the Statement. This willStatement
is returned.Statement
if a new lable is specified, otherwise the current label value.cp.rx.go.Statement:name()
cp.rx.go.Statement:Now([observer]) -> nil
Observable
. Defaults to the default observer factory.cp.rx.go.Statement:ThenDelay(millis) -> cp.rx.go.Statement
Statement
.cp.rx.go.Statement:ThenYield() -> cp.rx.go.Statement
Statement
will "yield" to allow other pending operations to happen,Statement
.cp.rx.go.Statement:TimeoutAfter(millis[, next][, scheduler]) -> cp.rx.go.Statement
number
or a function
returning the number of milliseconds to wait before timing out.resolvable
value indicating how to handle it.cp.rx.Scheduler
to use when timing out. Defaults to cp.rx.defaultScheduler()
.Statement
.cp.rx.go.Statement:toObservable([preserveTimer]) -> cp.rx.Observable
Observable
instance for the Statement
. Unless preserveTimer
is true
, this willObservable
.