WaveBeans/wavebeans

Output to support partial flush

asubb opened this issue · 0 comments

asubb commented

Some outputs may support flushing the file earlier and starting another one as per request or some other event.

As the event should be bypassed as a part of the stream, the wrapper Managed is introduced. The Managed allows to specify the signal and data at the same time, and hence react accordingly.

data class Managed<S, T> (
  val signal: S?,
  val data: T?
)

For the output, the signal Flush would be introduced:

typealias OutputSignal Int

const val FlushSignal = 0x01

As long as the output gets the FlushSignal it flushes the current written buffer and starts the new buffer over.

Output should support the name generation strategies or use default ones.

The current candidates to support flush are wav, csv and dev-null outputs.