public PipelineSection(string machineName, uint orderNumber, PipelineType pipelineType, string pipelineId, RolePlan rolePlan)
        {
            OrderNumber        = orderNumber;
            RoleType           = rolePlan.RoleType;
            Name               = rolePlan.Name;
            OutputSectionNames = rolePlan.OutputSectionNames ?? new List <string>();

            HiringPipeName = new HiringPipeName(machineName, pipelineId, Name);
            using (var hiringPipe = new Pipe(HiringPipeName))
            {
                hiringPipe.Create();

                for (uint slotNumber = 0; slotNumber < rolePlan.Slots; slotNumber++)
                {
                    RoleSlotToken roleSlot = new RoleSlotToken(slotNumber);
                    var           envelope = new PipeMessageEnvelope()
                    {
                        Body  = roleSlot,
                        Label = "RoleSlot " + slotNumber,
                    };

                    hiringPipe.Send(envelope);
                }
            }

            if (orderNumber > 0) // HACK - first role is not supposed to have data pipe
            {
                DataPipeName = new DataPipeName(machineName, pipelineType, pipelineId, Name);
                using (var dataPipe = new Pipe(DataPipeName))
                {
                    dataPipe.Create();
                }
            }
        }
Exemple #2
0
 public WorkRequest(
     string sectionName,
     DataPipeName sourceDataPipeName,
     HiringPipeName hiringPipeName,
     DataPipeName logDataPipeName,
     ReportPipeName reportPipeName,
     RoleType roleType,
     PipelineType pipelineType,
     string pipelineId,
     string bootParameters)
 {
     SectionName       = sectionName;
     InputDataPipeName = sourceDataPipeName;
     HiringPipeName    = hiringPipeName;
     LogDataPipeName   = logDataPipeName;
     ReportPipeName    = reportPipeName;
     PipelineType      = pipelineType;
     PipelineId        = pipelineId;
     RoleType          = roleType;
     BootParameters    = bootParameters;
 }