コード例 #1
0
 /// <summary>
 /// The on worker stopped.
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="args">
 /// The eventArgs.
 /// </param>
 private void OnWorkerStopped(object sender, WorkerStoppedEventArgs args)
 {
     if (this.WorkerStopped != null)
     {
         this.WorkerStopped(sender, args);
     }
 }
コード例 #2
0
 /// <summary>
 /// The OnWorkerStopped handler.
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="args">
 /// The args.
 /// </param>
 private void OnWorkerStopped(object sender, WorkerStoppedEventArgs args)
 {
     Trace.TraceInformation(
         "[Machine Name: {0}][DeploymentId: {1}][Role: {2}][Role Instance Id: {3}][Worker {4}] Stopped ({5:F6} seconds).",
         this.MachineName,
         this.DeploymentId,
         this.RoleInstanceName,
         this.RoleInstanceId,
         sender,
         args.Elapsed.TotalSeconds);
 }
コード例 #3
0
 /// <summary>
 /// The worker stop.
 /// </summary>
 /// <param name="role">
 /// The role.
 /// </param>
 /// <returns>
 /// The <see cref="IDisposable"/>.
 /// </returns>
 public IDisposable WorkerStop(object role)
 {
     return(GetActivityTracker(
                () =>
     {
         var args = new WorkerStoppingEventArgs();
         this.OnWorkerStopping(role, args);
     },
                t =>
     {
         var args = new WorkerStoppedEventArgs {
             Elapsed = t
         };
         this.OnWorkerStopped(role, args);
     }));
 }
コード例 #4
0
 private void OnWorkerStopped(object sender, WorkerStoppedEventArgs args)
 {
     try
     {
         this.workerEventWriter.Stopped(
             this.MachineName,
             this.DeploymentId,
             this.RoleInstanceName,
             this.RoleInstanceId,
             sender.ToString(),
             args.Elapsed.TotalSeconds.ToString(CultureInfo.InvariantCulture));
     }
     catch (Exception ex)
     {
         Trace.TraceError(ex.ToString());
     }
 }
コード例 #5
0
        private void Worker_Stopped(object sender, WorkerStoppedEventArgs workerStoppedEventArgs)
        {
            try
            {
                IPubSubResult result = PubSubClient.Publish(new PubSubMessage
                {
                    Event   = "task:onstopped",
                    Channel = "panteon",
                    Payload = new
                    {
                        TaskName = Name
                    }
                });

                Console.WriteLine(result.Body);
            }
            catch (Exception exception)
            {
                WorkerLogger.Error($"An error occurred while informing about [{Name}] stopping operation.", exception);
            }
        }
コード例 #6
0
        private void Worker_Stopped(object sender, WorkerStoppedEventArgs workerStoppedEventArgs)
        {
            try
            {
                IPubSubResult result = PubSubClient.Publish(new PubSubMessage
                {
                    Event = "task:onstopped",
                    Channel = "panteon",
                    Payload = new
                    {
                        TaskName = Name
                    }
                });

                Console.WriteLine(result.Body);
            }
            catch (Exception exception)
            {
                WorkerLogger.Error($"An error occurred while informing about [{Name}] stopping operation.", exception);
            }
        }
コード例 #7
0
 /// <summary>
 /// The worker stop.
 /// </summary>
 /// <param name="role">
 /// The role.
 /// </param>
 /// <returns>
 /// The <see cref="IDisposable"/>.
 /// </returns>
 public IDisposable WorkerStop(object role)
 {
     return GetActivityTracker(
         () =>
             {
                 var args = new WorkerStoppingEventArgs();
                 this.OnWorkerStopping(role, args);
             }, 
         t =>
             {
                 var args = new WorkerStoppedEventArgs { Elapsed = t };
                 this.OnWorkerStopped(role, args);
             });
 }
コード例 #8
0
 /// <summary>
 /// The on worker stopped.
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="args">
 /// The eventArgs.
 /// </param>
 private void OnWorkerStopped(object sender, WorkerStoppedEventArgs args)
 {
     if (this.WorkerStopped != null)
     {
         this.WorkerStopped(sender, args);
     }
 }
コード例 #9
0
 /// <summary>
 /// The OnWorkerStopped handler.
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="args">
 /// The args.
 /// </param>
 private void OnWorkerStopped(object sender, WorkerStoppedEventArgs args)
 {
     try
     {
         Debug.Print(
             "[Machine Name: {0}][DeploymentId: {1}][Role: {2}][Role Instance Id: {3}][Worker {4}] Stopped ({5:F6} seconds).", 
             this.MachineName, 
             this.DeploymentId, 
             this.RoleInstanceName, 
             this.RoleInstanceId, 
             sender, 
             args.Elapsed.TotalSeconds);
     }
     catch (ArgumentNullException ex)
     {
         Debug.Print(ex.ToString());
     }
     catch (FormatException ex)
     {
         Debug.Print(ex.ToString());
     }
 }
コード例 #10
0
 private void OnWorkerStopped(object sender, WorkerStoppedEventArgs args)
 {
     try
     {
         this.workerEventWriter.Stopped(
             this.MachineName, 
             this.DeploymentId, 
             this.RoleInstanceName, 
             this.RoleInstanceId, 
             sender.ToString(), 
             args.Elapsed.TotalSeconds.ToString(CultureInfo.InvariantCulture));
     }
     catch (Exception ex)
     {
         Trace.TraceError(ex.ToString());
     }
 }
コード例 #11
0
 /// <summary>
 /// The OnWorkerStopped handler.
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="args">
 /// The args.
 /// </param>
 private void OnWorkerStopped(object sender, WorkerStoppedEventArgs args)
 {
     this.NumberEventsFired++;
 }
コード例 #12
0
 /// <summary>
 /// The OnWorkerStopped handler.
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="args">
 /// The args.
 /// </param>
 private void OnWorkerStopped(object sender, WorkerStoppedEventArgs args)
 {
     Trace.TraceInformation(
         "[Machine Name: {0}][DeploymentId: {1}][Role: {2}][Role Instance Id: {3}][Worker {4}] Stopped ({5:F6} seconds).", 
         this.MachineName, 
         this.DeploymentId, 
         this.RoleInstanceName, 
         this.RoleInstanceId, 
         sender, 
         args.Elapsed.TotalSeconds);
 }
コード例 #13
0
 /// <summary>
 /// The OnWorkerStopped handler.
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="args">
 /// The args.
 /// </param>
 private void OnWorkerStopped(object sender, WorkerStoppedEventArgs args)
 {
     this.NumberEventsFired++;
 }