sharing
inline fun <ID : Any, Shared, Returned> Aggregate<ID>.sharing(initial: Shared, noinline body: YieldingContext<Shared, Returned>.(Field<ID, Shared>) -> YieldingResult<Shared, Returned>): Returned
sharing implements efficient stateful data sharing.
Namely, starting from an initial value, it computes a Shared through the body function, which is sent to all neighbors, and finally must return a Returned by calling YieldingContext.yielding.
Results are Aggregate.evolved across rounds, namely, this function also stores the local value of the field as state, and later invocations in successive rounds will not start from the provided initial value, rather, from the previously computed result.