Пример #1
0
        /// <summary>
        /// Requests a specific spawner to spawn a process
        /// </summary>
        /// <param name="properties"></param>
        /// <param name="customArgs"></param>
        /// <param name="spawner"></param>
        /// <returns></returns>
        public virtual SpawnTask Spawn(Dictionary <string, string> properties, string customArgs, RegisteredSpawner spawner)
        {
            var task = new SpawnTask(GenerateSpawnTaskId(), spawner, properties, customArgs);

            spawnTasksList[task.SpawnId] = task;

            spawner.AddTaskToQueue(task);

            logger.Debug("Spawner was found, and spawn task created: " + task);

            return(task);
        }
Пример #2
0
        /// <summary>
        /// Requests a specific spawner to spawn a process
        /// </summary>
        /// <param name="properties"></param>
        /// <param name="customArgs"></param>
        /// <param name="spawner"></param>
        /// <returns></returns>
        public virtual SpawnTask Spawn(Dictionary <string, string> properties, string customArgs, RegisteredSpawner spawner, string spawnID)
        {
            var task = new SpawnTask(spawnID, spawner, properties, customArgs);

            if (SpawnTasks.ContainsKey(task.UniqueCode))
            {
                Debug.LogError("Already have Spawner: " + task.UniqueCode);
                SpawnTasks.Remove(task.UniqueCode);
            }

            SpawnTasks.Add(task.UniqueCode, task);
            spawner.AddTaskToQueue(task);

            return(task);
        }
        /// <summary>
        /// Start process on spawner side with given spawn <paramref name="options"/>, <paramref name="customOptions"/> and <paramref name="spawner"/>
        /// </summary>
        /// <param name="options"></param>
        /// <param name="customOptions"></param>
        /// <param name="spawner"></param>
        /// <returns></returns>
        public virtual SpawnTask Spawn(DictionaryOptions options, DictionaryOptions customOptions, RegisteredSpawner spawner)
        {
            // Create new spawn task
            var task = new SpawnTask(GenerateSpawnTaskId(), spawner, options, customOptions);

            // List this task
            spawnTasksList[task.Id] = task;

            // Add this task to queue
            spawner.AddTaskToQueue(task);

            logger.Debug("Spawner was found, and spawn task created: " + task);

            return(task);
        }