Noop Operator

Rocket.noopFunction
noop()

Creates a noop operator, which does nothing, but breaks operator composition type inference checking procedure for Julia's compiler. It might be useful for very long chain of operators, because Julia tries to statically infer data types at compile-time for the whole chain and can run into StackOverflow issues.

using Rocket

# foo() block to enforce local scope for scope variable
function foo()
    source = from(1:5)

    for i in 1:1000
        source = source |> map(Int, d -> d + 1) |> noop()
    end

    subscribe!(source, logger())
end

foo()
;

# output

[LogActor] Data: 1001
[LogActor] Data: 1002
[LogActor] Data: 1003
[LogActor] Data: 1004
[LogActor] Data: 1005
[LogActor] Completed

See also: AbstractOperator, InferableOperator, logger, map

source

See also

Operators