コード例 #1
0
        /// <summary>
        /// Handles the PipeTo exception
        /// </summary>
        /// <param name="system">
        /// The actor system.
        /// </param>
        /// <param name="recipient">The recipient of the payload and/or exception </param>
        /// <param name="sender">The sender</param>
        /// <param name="exception">
        /// The exception
        /// </param>
        /// <returns>
        /// Routed object
        /// </returns>
        private object HandlePipedException(ActorSystem system, ICanTell recipient, IActorRef sender, Exception exception)
        {
            exception = this.ExtractException(exception);
            exception.Match()
                .With<ParcelTimeoutException>(
                () =>
                    {
                        var maxNumberOfAttempts = system.Settings.Config.GetInt("ClusterKit.LargeObjects.MaxReadAttempts", 5);
                        if (this.ReceiveAttempt < maxNumberOfAttempts)
                        {
                            var rereadInterval = system.Settings.Config.GetTimeSpan("ClusterKit.LargeObjects.RereadInterval", TimeSpan.FromSeconds(5));
                            system.Scheduler.ScheduleTellOnce(rereadInterval, recipient, this, sender);
                        }
                        else
                        {
                            exception = new ParcelServerErrorException("Server is unresponsive");
                        }
                    });

            return exception;
        }
コード例 #2
0
ファイル: Endpoint.cs プロジェクト: MaciekLesiczka/akka.net
        private void PublishAndThrow(Exception reason, LogLevel level)
        {
            reason.Match().With<EndpointDisassociatedException>(endpoint => PublishDisassociated())
                .Default(msg => PublishError(reason, level));

            throw reason;
        }
コード例 #3
0
ファイル: Endpoint.cs プロジェクト: Micha-kun/akka.net
        private void PublishAndThrow(Exception reason, LogLevel level)
        {
            reason.Match()
                .With<EndpointDisassociatedException>(endpoint => PublishDisassociated())
                .With<ShutDownAssociation>(shutdown => {}) // don't log an error for planned shutdowns
                .Default(msg => PublishError(reason, level));

            throw reason;
        }