的
fun <I, O> of(name: String, inputType: Class<I & Any>, outputType: Class<O & Any>, dispatcher: CoroutineDispatcher = defaultBodyDispatcher, body: NodeBody<I, O>): FunctionNode<I, O>
Returns a node named name that runs body on each input read as inputType and writes its outputType output as JSON. body runs on a thread of dispatcher, by default of Dispatchers.IO without its thread limit; see NodeBody:
FunctionNodes.of("report", String.class, String.class, myDispatcher, (ctx, city) -> ...);Content copied to clipboard
Throws
if Jackson cannot read and write inputType or write outputType, or if a port type has no single concrete JSON shape; a field type Jackson cannot handle fails on the first value instead.
fun <I, O> of(name: String, inputType: TypeReference<I>, outputType: TypeReference<O>, dispatcher: CoroutineDispatcher = defaultBodyDispatcher, body: NodeBody<I, O>): FunctionNode<I, O>
Like of with classes, for generic port types such as List<String>.
fun <I, O> of(name: String, inputType: Class<I & Any>, outputType: TypeReference<O>, dispatcher: CoroutineDispatcher = defaultBodyDispatcher, body: NodeBody<I, O>): FunctionNode<I, O>
Like of with classes, for a generic output type.
fun <I, O> of(name: String, inputType: TypeReference<I>, outputType: Class<O & Any>, dispatcher: CoroutineDispatcher = defaultBodyDispatcher, body: NodeBody<I, O>): FunctionNode<I, O>
Like of with classes, for a generic input type.