Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ClusterSingletonMessageSerializer"/> class.
 /// </summary>
 /// <param name="system">The actor system to associate with this serializer.</param>
 public ClusterSingletonMessageSerializer(ExtendedActorSystem system) : base(system)
 {
     _identifier    = SerializerIdentifierHelper.GetSerializerIdentifierFromConfig(this.GetType(), system);
     _fromBinaryMap = new Dictionary <string, Func <byte[], IClusterSingletonMessage> >
     {
         { HandOverToMeManifest, _ => HandOverToMe.Instance },
         { HandOverInProgressManifest, _ => HandOverInProgress.Instance },
         { HandOverDoneManifest, _ => HandOverDone.Instance },
         { TakeOverFromMeManifest, _ => TakeOverFromMe.Instance }
     };
 }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ClusterClientMessageSerializer"/> class.
 /// </summary>
 /// <param name="system">The actor system to associate with this serializer.</param>
 public ClusterClientMessageSerializer(ExtendedActorSystem system) : base(system)
 {
     Identifier     = SerializerIdentifierHelper.GetSerializerIdentifierFromConfig(GetType(), system);
     _fromBinaryMap = new Dictionary <string, Func <byte[], IClusterClientMessage> >
     {
         { ContactsManifest, ContactsFromBinary },
         { GetContactsManifest, _ => ClusterReceptionist.GetContacts.Instance },
         { HeartbeatManifest, _ => ClusterReceptionist.Heartbeat.Instance },
         { HeartbeatRspManifest, _ => ClusterReceptionist.HeartbeatRsp.Instance }
     };
 }
Example #3
0
 public DistributedPubSubMessageSerializer(ExtendedActorSystem system) : base(system)
 {
     _identifier    = SerializerIdentifierHelper.GetSerializerIdentifierFromConfig(this.GetType(), system);
     _fromBinaryMap = new Dictionary <string, Func <byte[], object> >
     {
         { StatusManifest, StatusFromBinary },
         { DeltaManifest, DeltaFromBinary },
         { SendManifest, SendFromBinary },
         { SendToAllManifest, SendToAllFromBinary },
         { PublishManifest, PublishFromBinary }
     };
 }
Example #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ClusterShardingMessageSerializer"/> class.
        /// </summary>
        /// <param name="system">The actor system to associate with this serializer.</param>
        public ClusterShardingMessageSerializer(ExtendedActorSystem system) : base(system)
        {
            _system     = system;
            _identifier = SerializerIdentifierHelper.GetSerializerIdentifierFromConfig(this.GetType(), system);

            _fromBinaryMap = new Dictionary <string, Func <byte[], object> >
            {
                { EntityStateManifest, EntityStateFromBinary },
                { EntityStartedManifest, EntityStartedFromBinary },
                { EntityStoppedManifest, EntityStoppedFromBinary },

                { CoordinatorStateManifest, CoordinatorStateFromBinary },
                { ShardRegionRegisteredManifest, bytes => new PersistentShardCoordinator.ShardRegionRegistered(ActorRefMessageFromBinary(bytes)) },
                { ShardRegionProxyRegisteredManifest, bytes => new PersistentShardCoordinator.ShardRegionProxyRegistered(ActorRefMessageFromBinary(bytes)) },
                { ShardRegionTerminatedManifest, bytes => new PersistentShardCoordinator.ShardRegionTerminated(ActorRefMessageFromBinary(bytes)) },
                { ShardRegionProxyTerminatedManifest, bytes => new PersistentShardCoordinator.ShardRegionProxyTerminated(ActorRefMessageFromBinary(bytes)) },
                { ShardHomeAllocatedManifest, ShardHomeAllocatedFromBinary },
                { ShardHomeDeallocatedManifest, bytes => new PersistentShardCoordinator.ShardHomeDeallocated(ShardIdMessageFromBinary(bytes)) },

                { RegisterManifest, bytes => new PersistentShardCoordinator.Register(ActorRefMessageFromBinary(bytes)) },
                { RegisterProxyManifest, bytes => new PersistentShardCoordinator.RegisterProxy(ActorRefMessageFromBinary(bytes)) },
                { RegisterAckManifest, bytes => new PersistentShardCoordinator.RegisterAck(ActorRefMessageFromBinary(bytes)) },
                { GetShardHomeManifest, bytes => new PersistentShardCoordinator.GetShardHome(ShardIdMessageFromBinary(bytes)) },
                { ShardHomeManifest, ShardHomeFromBinary },
                { HostShardManifest, bytes => new PersistentShardCoordinator.HostShard(ShardIdMessageFromBinary(bytes)) },
                { ShardStartedManifest, bytes => new PersistentShardCoordinator.ShardStarted(ShardIdMessageFromBinary(bytes)) },
                { BeginHandOffManifest, bytes => new PersistentShardCoordinator.BeginHandOff(ShardIdMessageFromBinary(bytes)) },
                { BeginHandOffAckManifest, bytes => new PersistentShardCoordinator.BeginHandOffAck(ShardIdMessageFromBinary(bytes)) },
                { HandOffManifest, bytes => new PersistentShardCoordinator.HandOff(ShardIdMessageFromBinary(bytes)) },
                { ShardStoppedManifest, bytes => new PersistentShardCoordinator.ShardStopped(ShardIdMessageFromBinary(bytes)) },
                { GracefulShutdownReqManifest, bytes => new PersistentShardCoordinator.GracefulShutdownRequest(ActorRefMessageFromBinary(bytes)) },

                { GetShardStatsManifest, bytes => Shard.GetShardStats.Instance },
                { ShardStatsManifest, ShardStatsFromBinary }
            };
        }
Example #5
0
 public ClusterSingletonMessageSerializer(ExtendedActorSystem system) : base(system)
 {
     _identifier = SerializerIdentifierHelper.GetSerializerIdentifierFromConfig(this.GetType(), system);
 }