コード例 #1
0
        /// <summary>
        /// Registers the specified extension with this actor system.
        /// </summary>
        /// <param name="extension">The extension to register with this actor system</param>
        /// <returns>The extension registered with this actor system</returns>
        public override object RegisterExtension(IExtensionId extension)
        {
            if (extension == null)
            {
                return(null);
            }

            _extensions.GetOrAdd(extension.ExtensionType, t => new Lazy <object>(() => extension.CreateExtension(this), LazyThreadSafetyMode.ExecutionAndPublication));

            return(extension.Get(this));
        }
コード例 #2
0
ファイル: ActorSystemImpl.cs プロジェクト: yu8440348/akka.net
        public override object RegisterExtension(IExtensionId extension)
        {
            if (extension == null)
            {
                return(null);
            }
            if (!_extensions.ContainsKey(extension.ExtensionType))
            {
                _extensions.TryAdd(extension.ExtensionType, new Lazy <object>(() => extension.CreateExtension(this)));
            }

            return(extension.Get(this));
        }
コード例 #3
0
        /// <summary>
        /// Registers a new extensionBase to the ActorSystem
        /// </summary>
        /// <param name="extensionBase">The extensionBase to register</param>
        public object RegisterExtension(IExtensionId extensionBase)
        {
            if (extensionBase == null)
            {
                return(null);
            }
            if (!_extensions.ContainsKey(extensionBase.ExtensionType))
            {
                _extensions.TryAdd(extensionBase.ExtensionType, extensionBase.CreateExtension(this));
            }

            return(extensionBase.Get(this));
        }