/// <summary> /// Schedules an instance of <see cref="BusTask"/> /// </summary> /// <param name="task">The task.</param> public void Schedule(BusTask task) { workingQueue[task.Queue].Enqueue(task); }
/// <summary> /// Adds a task to the error queue /// </summary> /// <param name="task">The task.</param> public void AddFailed(BusTask task) { errorQueue[task.Queue].Enqueue(task); }
/// <summary> /// Schedules a new job /// </summary> /// <param name="data">The data to processed by the task</param> /// <exception cref="System.InvalidOperationException">queue does not exist</exception> public void Schedule(string data) { var messageType = RetrieveMessageType(data); var queue = ResolveQueueForExecutor(messageType); if (!workingQueue.ContainsKey(queue)) throw new InvalidOperationException("queue does not exist"); var task = new BusTask(queue, messageType, data); DatabaseManager.Instance.Add(task); workingQueue[queue].Enqueue(task); }