icinga-powershell-framework/lib/core/thread/New-IcingaThreadPool.psm1

19 lines
375 B
PowerShell
Raw Normal View History

function New-IcingaThreadPool()
{
param(
[int]$MinInstances = 1,
[int]$MaxInstances = 5
);
$Runspaces = [RunspaceFactory]::CreateRunspacePool(
$MinInstances,
$MaxInstances,
[System.Management.Automation.Runspaces.InitialSessionState]::CreateDefault(),
$host
)
$Runspaces.Open();
return $Runspaces;
}