コード例 #1
0
        private string AddItemToSequentialQueue(EventHandlerEnvironment env)
        {
            // Sanity.
            if (string.IsNullOrWhiteSpace(env?.Input))
            {
                return("No item provided.");
            }
            if (false == ObjVerEx.TryParse(env.Vault, env.Input, out ObjVerEx item))
            {
                return($"Input '{env.Input}' not in expected format.");
            }

            SysUtils.ReportInfoToEventLog($"Adding {item.ToString()} to the queue.");

            // Create a task in the task queue.
            var itemId = this.TaskProcessor.CreateApplicationTaskSafe
                         (
                true,
                VaultApplication.SequentialTaskQueueId,
                VaultApplication.TaskTypeSequentialTask,
                new ObjVerExTaskQueueDirective {
                ObjVerEx = item.ToString()
            }.ToBytes()
                         );

            // Return the ID.
            return(itemId);
        }