Beispiel #1
0
        /// <summary>
        /// Initialize own id if this register instance assigns ids
        /// </summary>
        public void SelfRegister()
        {
            if (!AssignIds)
            {
                return;
            }
            var id = idManager.GetId();

            idToObjectDictionary.Add(id, this);
            keyToIdDictionary.Add(Key, id);
            isInternalIdBound     = true;
            InternalIdBindUtcTime = DateTime.UtcNow;
            BroadcastMessage(GetCommandMessage(IdsRegisterCommandType.BindIdAndKey, this));
        }
Beispiel #2
0
        /// <summary>
        /// Initialize own id if this register instance assigns ids
        /// </summary>
        public void SelfRegister()
        {
            if (!AssignIds)
            {
                return;
            }

            var id = idManager.GetId();

            idToObjectDictionary.Add(id, this);
            keyToIdDictionary.Add(Key, id);
            isInternalIdBound     = true;
            InternalIdBindUtcTime = DateTime.UtcNow;
            idRegistrationTimestamp.Add(id, InternalIdBindUtcTime);
            BroadcastMessage(GetInitializationMessage());
        }