cs-codex-dist-tests/KubernetesWorkflow/WorkflowNumberSource.cs

29 lines
754 B
C#
Raw Normal View History

using Utils;
namespace KubernetesWorkflow
{
public class WorkflowNumberSource
{
private readonly NumberSource containerNumberSource = new NumberSource(0);
private readonly NumberSource servicePortNumberSource;
public WorkflowNumberSource(int workflowNumber, NumberSource servicePortNumberSource)
{
WorkflowNumber = workflowNumber;
this.servicePortNumberSource = servicePortNumberSource;
}
public int WorkflowNumber { get; }
public int GetContainerNumber()
{
return containerNumberSource.GetNextNumber();
}
public int GetServicePort()
{
return servicePortNumberSource.GetNextNumber();
}
}
}