715bb7274a
* Can debug dependencies * Different exceptions * Uses root id only after we found it to signal the end * DataChunks are created later and need to be accounted for * format * use app ids in tests and references * check sqlite cache after serialize * use dummy to go through channels to end * fmt * Extend channel lib to batch by size * fmt * build fix * adjust limits * FIx sending * Optimize reference generation * more * remove tolist * rework closures to be constant and serializer only deals with current....references bases are cached * fix chunk creation * another bug fix * clean up with factories * add deserializer factory * Needed to reference interface * move around streamId * some clean up * Use StringBuilder pool on serialization to reduce memory pressure * remove extra * remove extra clears * Fix a flaw in batchsize * use default complete * format * loader should use 1 writer that is batched * remove redundant ref gen * Fix graphql commands by adding project id
22 lines
603 B
C#
22 lines
603 B
C#
using System.Threading.Channels;
|
|
using Open.ChannelExtensions;
|
|
using Speckle.Sdk.Dependencies.Serialization;
|
|
|
|
namespace Speckle.Sdk.Serialisation.V2.Send;
|
|
|
|
public static class ChannelExtensions
|
|
{
|
|
public static BatchingChannelReader<BaseItem, List<BaseItem>> BatchBySize(
|
|
this ChannelReader<BaseItem> source,
|
|
int batchSize,
|
|
bool singleReader = false,
|
|
bool allowSynchronousContinuations = false
|
|
) =>
|
|
new SizeBatchingChannelReader(
|
|
source ?? throw new ArgumentNullException(nameof(source)),
|
|
batchSize,
|
|
singleReader,
|
|
allowSynchronousContinuations
|
|
);
|
|
}
|