flancy icon indicating copy to clipboard operation
flancy copied to clipboard

Add -AsJob Parameter to New-Flancy

Open adamdriscoll opened this issue 9 years ago • 4 comments

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.

adamdriscoll avatar Nov 04 '15 14:11 adamdriscoll

I tried it, but there were some issues.

toenuff avatar Nov 04 '15 15:11 toenuff

@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...

beatcracker avatar Nov 04 '15 15:11 beatcracker

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.

toenuff avatar Nov 04 '15 18:11 toenuff

I think we have all the issues resolved now - just need to implement as per #33

toenuff avatar Dec 06 '15 04:12 toenuff