- com.industry.rx_epl.Observable
- com.industry.rx_epl.Subject
- com.industry.rx_epl.BehaviorSubject
- com.industry.rx_epl.ReplaySubject
- com.industry.rx_epl.IObservable
- com.industry.rx_epl.ISubject
- com.industry.rx_epl.ISubscription
- com.industry.rx_epl.IDisposable
- com.industry.rx_epl.IResolver
- com.industry.rx_epl.Subscriber
- com.industry.rx_epl.LoggingSubscriber
- com.industry.rx_epl.DisposableStream
- com.industry.rx_epl.TimeInterval
- com.industry.rx_epl.TimestampedValue
- com.industry.rx_epl.WrappedAny
- com.industry.rx_epl.operators.*
All of the standard operators (except publish
, connect
, refCount
, share
...) can be used in two ways:
Chaining - Accessible from the IObservable interface.
Observable.fromValues([1,2,3])
.map(multiplyBy10)
.reduce(sumValues)
...
Piping - Accessible via the com.industry.rx_epl.operators.*
sub-package, and used via the .let(...) and .pipe(...) operators.
using com.industry.rx_epl.operators.Map;
using com.industry.rx_epl.operators.Reduce;
Observable.fromValues([1,2,3])
.let(Map.create(multiplyBy10))
.let(Reduce.create(sumValues))
...
Observable.fromValues([1,2,3])
.pipe([
Map.create(multiplyBy10),
Reduce.create(sumValues)
])
...
For a list of operators see: IObservable
In the API documentation you will see notation like:
This means any of the following would be acceptable:
- action<integer> returns integer
- action<float> returns float
- action<string> returns string
But, the following would not be acceptable:
- action<float> returns integer
However, it would be acceptable if the definition was:
In practice this is frequently used with any operators that take actions:
.map(action<value:
T1> returns T2) returns IObservable<T2>
Here we can see that map takes an argument which is an action. The action must have 1 argument (of any type) and return a value (of any type). The return type of the action determines the return type of the IObservable.
As such, any action that meets the criteria is an acceptable action to use with the map operator:
action multiplyIntegerBy10(integer value) returns integer {
return value * 10;
}
action convertValueToString(any value) returns string {
return value.valueToString();
}
This is possible because the real method signature of .map(...)
is:
.map(any) returns IObservable
However, there are strict runtime checks to make sure you don't provide anything invalid (eg. a string).