FeatureMessageFileWriter

abstract class FeatureMessageFileWriter<Path>(val targetPath: Path, sinkOpener: (Path) -> Sink) : FeatureMessageProcessor(source)

A feature message processor responsible for writing feature messages to a file. This abstract class provides functionality to convert and write feature messages into a target file using a specified file system provider.

Parameters

targetPath

The file where feature messages will be written.

sinkOpener

Returns a Sink for writing to the file, this class manages its lifecycle.

Type Parameters

Path

The type representing paths supported by the file system provider.

Constructors

Link copied to clipboard
constructor(targetPath: Path, sinkOpener: (Path) -> Sink)

Properties

Link copied to clipboard
open override val isOpen: StateFlow<Boolean>

Indicates whether the writer is currently open and ready for operation.

Link copied to clipboard

A filter for messages to be sent to message processors.

Link copied to clipboard

Functions

Link copied to clipboard
open suspend override fun close()

Releases resources held by this processor.

Link copied to clipboard
open suspend override fun initialize()

Initializes the feature output stream provider to ensure it is ready for use.

Link copied to clipboard
expect suspend fun onMessage(message: FeatureMessage)

Receives and processes an incoming feature message.

Link copied to clipboard
expect fun setMessageFilter(filter: (FeatureMessage) -> Boolean)

Sets the message filter used to determine which feature messages should be processed.

Link copied to clipboard

Converts the FeatureMessage instance to its corresponding string representation suitable for writing to a file.