Ejemplo n.º 1
0
        bool ReleaseInactiveSlaves()
        {
            // Make sure we didn't just barely request a new slave?
            if (DateTime.Now > mNextSlaveRequstTime)
            {
                // Check if we have any remaining auto-launched slaves that can be shut down?
                if (mAutoLaunchedSlaveNames.Count != 0)
                {
                    // Check if enough time has passed since our last shutdown?
                    if (DateTime.Now > mNextSlaveReleaseTime)
                    {
                        // Get the slave off of the bottom of our mAutoLaunchedSlaveNames
                        string slaveName = (String)mAutoLaunchedSlaveNames[mAutoLaunchedSlaveNames.Count - 1];
                        // Remove this slave from our list
                        RemoveAutoLaunchedSlaveName(slaveName);

                        // Check if there is already a slave running on this machine?
                        if (LocateAvailableSlaveByComputerName(slaveName) != null)
                        {
                            // Inform this slave to terminate itself
                            MOG_ControllerSystem.ShutdownSlave(slaveName);
                            mNextSlaveReleaseTime = DateTime.Now.AddSeconds(5);
                            return(true);
                        }
                    }
                }
            }

            return(false);
        }
Ejemplo n.º 2
0
        internal bool Command_KillCommand(MOG_Command pCommand)
        {
            // Enumerate through all the jobs
            foreach (MOG_JobInfo job in mJobOrder)
            {
                if (job != null)
                {
                    // Attempt to remove the command from this job
                    job.KillCommand(pCommand.GetCommandID());
                }
            }

            // Check the active slaves to see if it is being processed?
            // Just in case the command we want to kill has already been tasked out to a slave
            for (int c = 0; c < mActiveSlaves.Count; c++)
            {
                // Check this slave's assigned command?
                MOG_Command activeSlave    = (MOG_Command)mActiveSlaves[c];
                MOG_Command pActiveCommand = activeSlave.GetCommand();
                if (pActiveCommand != null)
                {
                    // Checkif the CommandID matches?
                    if (pActiveCommand.GetCommandID() == pCommand.GetCommandID())
                    {
                        // Clear the command this slave is working on
                        activeSlave.SetCommand(null);

                        // Always kill the connection to this slave just in case it was hung by the command
                        MOG_ControllerSystem.ShutdownSlave(activeSlave.GetNetworkID());
                        break;
                    }
                }
            }

            // Always eat this command
            return(true);
        }
Ejemplo n.º 3
0
 internal bool Command_RetaskCommand(MOG_Command pCommand)
 {
     // Shutdown this slave and its command will be automatically recycled
     return(MOG_ControllerSystem.ShutdownSlave(pCommand.GetNetworkID()));
 }
Ejemplo n.º 4
0
 public void SlaveDel()
 {
     // Remove a slave
     MOG_ControllerSystem.ShutdownSlave();
 }