def turn.value
import ezmcp@0.1.0.0/src/server.bend as Serverimport Base
import emerging-ezjson@1.2.0.0/main.bend as Json
import emerging-ezjson@1.2.0.0/src/value.bend as Value
import ezmcp@0.1.0.0/src/rpc.bend as Rpc
356# a decoded value: a batch when it is an array and the revision receives
357# batches, else one message
358def turn.value(srv: Server, rev: String, +val: Value.Json, many: Bool) -> Turn:
359 match many:
360 case True{}:
361 Turn{batch(srv, Json.items(val)), rev}
362 case False{}:
363 turn.msg(srv, rev, Rpc.classify(val))