input Output
inline fun <M, I : M, O : M> inputOutput(inputMessage: String = "input message", outputMessage: String = "output message", crossinline predicate: (I, O) -> Boolean): Formula<M>
General pattern for input-output behavior. The obtained formula specifies that for every input message of type I there should be a corresponding output message of type O which satisfies the relation given by predicate.
In general you want to use this function over the merge
of the input and output flows, where you somehow mark the provenance of each message in some way.
merge(
inputFlow.map { In(it) },
outputFlow.map { Out(it) }
).testFormula {
inputOutput { input: In, output: Out ->
// do something
}
}
Content copied to clipboard