Exemple #1
0
        private void LogTaskStarted(TaskInfo info)
        {
            var logMessage = Messages.TaskStarted(info);

            ThreadSafeColoredConsole.Info(logMessage);
        }
Exemple #2
0
        private void LogTaskFinished(TaskInfo info, double completionSeconds)
        {
            var logMessage = Messages.TaskFinished(info, completionSeconds);

            ThreadSafeColoredConsole.Info(logMessage);
        }
Exemple #3
0
        private void LogTaskStarted(TaskInfo info)
        {
            var logMessage = Messages.TaskStarted(info);

            Trace.Info(logMessage);
        }
Exemple #4
0
        private void LogTaskFinished(TaskInfo info, double completionSeconds)
        {
            var logMessage = Messages.TaskFinished(info, completionSeconds);

            Trace.Info(logMessage);
        }
Exemple #5
0
 public static string TaskThrewException(TaskInfo info) =>
 $"[{DateTime.Now.ToShortTimeString()}] Task Error: {info.AssemblyName}.{info.MethodName} threw an exception. (Task Id: {info.Id})";
Exemple #6
0
        private void LogTaskException(TaskInfo info, Exception exception)
        {
            var logMessage = Messages.TaskThrewException(info);

            Trace.Exception(logMessage, exception);
        }
Exemple #7
0
 public static string TaskStarted(TaskInfo info) =>
 $"[{DateTime.Now.ToShortTimeString()}] Task Received: {info.AssemblyName}.{info.MethodName} (Task Id: {info.Id})";
Exemple #8
0
 public static string TaskFinished(TaskInfo info, double completionSeconds) =>
 $"[{DateTime.Now.ToShortTimeString()}] Task Finished ({completionSeconds}s): {info.AssemblyName}.{info.MethodName} (Task Id: {info.Id})";
Exemple #9
0
 internal void AddScheduledTask(TaskInfo taskInfo, TimeSpan interval, string taskName)
 {
     _scheduledTasks[taskName] = new TaskSchedule(taskInfo, interval, _taskQueue.Backend);
 }
Exemple #10
0
        private void Enqueue(TaskInfo taskInfo)
        {
            var jsonString = Config.TaskInfoSerializer.Serialize(taskInfo);

            Backend.Enqueue(jsonString);
        }
Exemple #11
0
 internal void AddScheduledTask(TaskInfo taskInfo, TimeSpan interval, string taskName)
 {
     // TODO: Support Scheduled Tasks with args
     _scheduledTasks[taskName] = new TaskSchedule(taskInfo, interval, _taskQueue.Backend);
 }
Exemple #12
0
 public ScheduledTask(
     TaskInfo taskInfo,
     TimeSpan offset,
     string taskKey) : this(taskInfo, new DateTimeOffset(DateTime.UtcNow + offset), taskKey)
 {
 }
Exemple #13
0
        private void LogTask(TaskInfo info)
        {
            var logMessage = $"Task Received: {info.AssemblyName}.{info.MethodName}";

            Console.WriteLine(logMessage);
        }