Max Operator

Base.maxFunction
max(; from = nothing)

Creates a max operator, which emits a single item: the item with the largest value.

Arguments

  • from: optional initial maximum value, if nothing 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

source

Description

The max operator operates on an Observable of similar objects. When the source Observable completes, it emits the item with the largest value.

See also

Operators