psi
psi copied to clipboard
Is there any Framing component?
A Frame operator or component for returning non-overlapped grouped messages? A similar operator is Window, but it gives overlapped messages.
We don't currently have such an operator, but it's a good idea, and we will look into the possibility of extending our current set of Window operators to handle such a case.
For now, you can probably accomplish what you want pretty easily with a Process operator and some state. For example, for a stream with messages of type T, you could try the following:
var group = new T[groupSize];
var index = 0;
var groupedStream = myStream.Process<T, T[]>((data, envelope, emitter) =>
{
group[index++] = data.DeepClone();
if (index >= groupSize)
{
index = 0;
emitter.Post(group, envelope.OriginatingTime);
}
});