Esempio n. 1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="heliumActorSystem">Helium Actor System</param>
        /// <param name="thuriaSerializer">Thuria Serializer</param>
        /// <param name="responseNegotiator">Nancy Response Negotiator</param>
        /// <param name="thuriaLogger">Thuria Logger</param>
        public HeliumInsertModule(IThuriaActorSystem heliumActorSystem, IThuriaSerializer thuriaSerializer, IResponseNegotiator responseNegotiator, IThuriaLogger thuriaLogger)
            : base(thuriaSerializer, responseNegotiator, thuriaLogger)
        {
            _heliumActorSystem = heliumActorSystem ?? throw new ArgumentNullException(nameof(heliumActorSystem));

            Post("/insert", async(parameters, token) => await ProcessRequest());

            ThuriaLogger.LogMessage(LogSeverity.Info, "Helium Insert ready to receive requests");
        }
        /// <inheritdoc />
        public void Dispose()
        {
            if (_isDisposing)
            {
                return;
            }

            _isDisposing = true;
            if (ActorSystem == null)
            {
                return;
            }

            Stop();
            ActorSystem = null;
        }
 /// <summary>
 /// Thuria Actor Service Base Constructor
 /// </summary>
 /// <param name="actorSystem">Actor System</param>
 protected ThuriaActorServiceBase(IThuriaActorSystem actorSystem)
 {
     ActorSystem = actorSystem ?? throw new ArgumentNullException(nameof(actorSystem));
 }