示例#1
0
        public static bool TryRemoveJob(JobID jobID, out JobAction job)
        {
            if (Jobs.TryRemove(jobID, out job))
            {
                Log.WriteDebug("Job Manager", "Removed job: {0} ({1} jobs left)", jobID, Jobs.Count);

                return(true);
            }

            return(false);
        }
示例#2
0
        public static bool TryRemoveJob(JobID jobID, out JobAction job)
        {
            if (Jobs.TryRemove(jobID, out job))
            {
                Log.WriteDebug("Job Manager", "Removed job: {0} ({1} jobs left)", jobID, Jobs.Count);

                return true;
            }

            return false;
        }
示例#3
0
        public static void AddJob(Func <JobID> action)
        {
            var jobID = action();

            var job = new JobAction
            {
                Action = action
            };

            Log.WriteDebug("Job Manager", "New job: {0}", jobID);

            Jobs.TryAdd(jobID, job);
        }
示例#4
0
        public static bool TryRemoveJob(JobID jobID, out JobAction job)
        {
            if (Jobs.TryRemove(jobID, out job))
            {
#if DEBUG
                Log.WriteDebug(nameof(JobManager), $"Removed job: {jobID} ({Jobs.Count} jobs left)");
#endif

                return(true);
            }

            return(false);
        }
        public static void AddJob(Func<JobID> action)
        {
            var jobID = action();

            var job = new JobAction
            {
                Action = action
            };

            Log.WriteDebug("Job Manager", "New job: {0}", jobID);

            Jobs.TryAdd(jobID, job);
        }
示例#6
0
        public static void AddJob(Func <JobID> action, DepotProcessor.ManifestJob manifestJob)
        {
            var jobID = action();

            var job = new JobAction
            {
                Action      = action,
                ManifestJob = manifestJob
            };

            Log.WriteDebug("Job Manager", "New depot job: {0} ({1} - {2})", jobID, manifestJob.DepotID, manifestJob.ManifestID);

            Jobs.TryAdd(jobID, job);
        }
示例#7
0
        public static void AddJob(Func <JobID> action, CommandArguments command)
        {
            var jobID = action();

            var job = new JobAction
            {
                Action  = action,
                Command = command
            };

            // Chat rooms don't have full message saved
            Log.WriteDebug("Job Manager", "New chat job: {0} ({1})", jobID, command.Message);

            Jobs.TryAdd(jobID, job);
        }
示例#8
0
        public static void AddJob(Func <JobID> action)
        {
            var jobID = action();

            var job = new JobAction
            {
                Action = action
            };

#if DEBUG
            Log.WriteDebug(nameof(JobManager), $"New job: {jobID}");
#endif

            Jobs.TryAdd(jobID, job);
        }
        public static void AddJob(Func<JobID> action, CommandArguments command)
        {
            var jobID = action();

            var job = new JobAction
            {
                Action = action,
                Command = command
            };

            // Chat rooms don't have full message saved
            Log.WriteDebug("Job Manager", "New chat job: {0} ({1})", jobID, command.Message);

            Jobs.TryAdd(jobID, job);
        }
示例#10
0
        public static void AddJob(Func <JobID> action, object metadata)
        {
            var jobID = action();

            var job = new JobAction
            {
                Action   = action,
                Metadata = metadata,
            };

#if DEBUG
            Log.WriteDebug(nameof(JobManager), $"New job: {jobID} (with data)");
#endif

            Jobs.TryAdd(jobID, job);
        }
示例#11
0
        public static void AddJob(Func <JobID> action, CommandArguments command)
        {
            var jobID = action();

            var job = new JobAction
            {
                Action  = action,
                Command = command
            };

#if DEBUG
            // Chat rooms don't have full message saved
            Log.WriteDebug(nameof(JobManager), $"New chat job: {jobID} ({command.Message})");
#endif

            Jobs.TryAdd(jobID, job);
        }
        public static void AddJob(Func<JobID> action, IRCRequest request)
        {
            RemoveStaleJobs();

            var jobID = action();

            request.ExpireTime = DateTime.Now + TimeSpan.FromSeconds(CHAT_COMMAND_TIMEOUT);

            var job = new JobAction
            {
                Action = action,
                CommandRequest = request
            };

            // Chat rooms don't have full message saved
            Log.WriteDebug("Job Manager", "New chat job: {0} ({1})", jobID, request.Command.Message);

            Jobs.TryAdd(jobID, job);
        }
示例#13
0
        public static void AddJob(Func <JobID> action, IRCRequest request)
        {
            RemoveStaleJobs();

            var jobID = action();

            request.ExpireTime = DateTime.Now + TimeSpan.FromSeconds(CHAT_COMMAND_TIMEOUT);

            var job = new JobAction
            {
                Action         = action,
                CommandRequest = request
            };

            // Chat rooms don't have full message saved
            Log.WriteDebug("Job Manager", "New chat job: {0} ({1})", jobID, request.Command.Message);

            Jobs.TryAdd(jobID, job);
        }
        public static void AddJob(Func<JobID> action, DepotProcessor.ManifestJob manifestJob)
        {
            var jobID = action();

            var job = new JobAction
            {
                Action = action,
                ManifestJob = manifestJob
            };

            Log.WriteDebug("Job Manager", "New depot job: {0} ({1} - {2})", jobID, manifestJob.DepotID, manifestJob.ManifestID);

            Jobs.TryAdd(jobID, job);
        }