The callback is invoked as callback(chunk, state, context) and must return
a list containing output, state, events, and diagnostics. Operation
states are committed only after the full graph succeeds.
Examples
sos <- matrix(c(1, 0, 0, 1, 0, 0), 1L, 6L,
dimnames = list(NULL, c("b0", "b1", "b2", "a0", "a1", "a2")))
pipeline <- streamPipeline(chunk_size = 8L)
onChunk(pipeline, bandpassRmsOp(sos, window_samples = 4L))
length(pipelineState(pipeline)$operations)
#> [1] 1