Inheritance: IDistributedPubSubMessage
Beispiel #1
0
        private Akka.Cluster.PubSub.Serializers.Proto.Delta DeltaToProto(Delta delta)
        {
            var buckets = delta.Buckets.Select(b =>
            {
                var entries = b.Content.Select(c =>
                {
                    var bb = Akka.Cluster.PubSub.Serializers.Proto.Delta.Types.Entry.CreateBuilder()
                             .SetKey(c.Key).SetVersion(c.Value.Version);
                    if (c.Value.Ref != null)
                    {
                        bb.SetRef(Akka.Serialization.Serialization.SerializedActorPath(c.Value.Ref));
                    }
                    return(bb.Build());
                });
                return(Akka.Cluster.PubSub.Serializers.Proto.Delta.Types.Bucket.CreateBuilder()
                       .SetOwner(AddressToProto(b.Owner))
                       .SetVersion(b.Version)
                       .AddRangeContent(entries)
                       .Build());
            }).ToArray();

            return(Akka.Cluster.PubSub.Serializers.Proto.Delta.CreateBuilder()
                   .AddRangeBuckets(buckets)
                   .Build());
        }
        private Akka.Cluster.PubSub.Serializers.Proto.Delta DeltaToProto(Delta delta)
        {
            var buckets = delta.Buckets.Select(b =>
            {
                var entries = b.Content.Select(c =>
                {
                    var bb = Akka.Cluster.PubSub.Serializers.Proto.Delta.Types.Entry.CreateBuilder()
                        .SetKey(c.Key).SetVersion(c.Value.Version);
                    if (c.Value.Ref != null)
                    {
                        bb.SetRef(Akka.Serialization.Serialization.SerializedActorPath(c.Value.Ref));
                    }
                    return bb.Build();
                });
                return Akka.Cluster.PubSub.Serializers.Proto.Delta.Types.Bucket.CreateBuilder()
                    .SetOwner(AddressToProto(b.Owner))
                    .SetVersion(b.Version)
                    .AddRangeContent(entries)
                    .Build();
            }).ToArray();

            return Akka.Cluster.PubSub.Serializers.Proto.Delta.CreateBuilder()
                .AddRangeBuckets(buckets)
                .Build();
        }