flancy
flancy copied to clipboard
Add -AsJob Parameter to New-Flancy
Would be nice to just tack on an -AsJob parameter so that we can out-of-proc the Nancy host to make it easier to run subsequent New-Flancy calls.
I tried it, but there were some issues.
@toenuff What issues? I'm running Flancy like this and it's working ok:
# Start Flancy
Start-Job -Name Flancy -ScriptBlock {
Import-Module -Name 'Flancy' -ErrorAction Stop
New-Flancy -url $Url -webschema @(
@{
path = '/'
method = 'Get'
script = {'Test!'}
}
)
while($true){Start-Sleep -Seconds 1}
} -ArgumentList $Url
}
# Stop Flancy
Get-Job Flancy | Stop-Job -PassThru | Remove-Job
Should be fairly easy to add something like this to the New-Flancy
...
I had the problem either in tests or by changing the compiled flancy. It may have just been an ordered thing. We should definitely revisit. It would be nice to be able to run multiple flancies in a session.
I think we have all the issues resolved now - just need to implement as per #33