Is there a serializer to convert a Flow<Foo>...
# serialization
d
Is there a serializer to convert a Flow<Foo> to a json arrary of Foo objects (as the Foos are coming in...)? I could technically do toList(), but I wanted to avoid the extra allocation and copying into the list.
k
No. Serializers are synchronous functions and therefore cannot collect a flow to then serialize its elements.
d
I guess there could be a workaround then, if the json builder function is used to build the array and a serializer to serialize each Foo into an object...
Thanks!