receiveAll

@Suspendable
@NotNull
abstract fun <R> receiveAll(@NotNull receiveType: Class<out R>, @NotNull sessions: Set<FlowSession>): List<R>

Suspends until a message has been received for each session in the specified sessions.

Consider receiveAllMap when sessions are expected to receive different types.

The receiveType should be of a type that is annotated with @CordaSerializable or a primitive type. This function cannot handle types that do not meet these criteria.

Return

a List containing the objects received from the sessions.

Parameters

<R>

type of object to be received for all sessions.

receiveType

Type of object to be received for all sessions, which should be either a primitive type or a type annotated with @CordaSerializable.

sessions

Set of sessions to receive from.

Throws

CordaRuntimeException

if any session is closed or in a failed state.