Max Operator
Base.max
— Functionmax(; from = nothing)
Creates a max operator, which emits a single item: the item with the largest value.
Arguments
from
: optional initial maximum value, ifnothing
first item from the source will be used as initial instead
Producing
Stream of type <: Subscribable{Union{L, Nothing}}
where L
refers to type of source stream
Examples
using Rocket
source = from([ i for i in 1:42 ])
subscribe!(source |> max(), logger())
;
# output
[LogActor] Data: 42
[LogActor] Completed
See also: AbstractOperator
, InferableOperator
, ProxyObservable
, logger
Description
The max
operator operates on an Observable of similar objects. When the source Observable completes, it emits the item with the largest value.