Would it be possible to make RestPS handle requests asynchronously?
Imagine I have a dummy endpoint script that just does the following:
Start-Sleep -Seconds 30
Return "Wake Up"
If this endpoint is triggered, the /endpoint/status endpoint (and all other endpoints) also stop responding until the 30 second sleep is complete.
I'm no powershell expert like you kind folks but I did a little reading.
There is a "HttpListener.GetContextAsync" method but that just let's do do other things until the request context is ready. Apply timeouts, etc. It doesn't run the response generation logic Async.
Maybe, once you have a Context (Start-RestPSListener.ps1:80) you could pass off to a Job that does everything from Start-RestPSListener.ps1:85 to 163 so the loop that starts on Start-RestPSListener.ps1:75 could immediately get ready to "Invoke-GetContext" the next incoming (parallel) request. I dunno. I'm just guessing.
Hello.
Would it be possible to make RestPS handle requests asynchronously?
Imagine I have a dummy endpoint script that just does the following:
If this endpoint is triggered, the /endpoint/status endpoint (and all other endpoints) also stop responding until the 30 second sleep is complete.
I'm no powershell expert like you kind folks but I did a little reading.
There is a "HttpListener.GetContextAsync" method but that just let's do do other things until the request context is ready. Apply timeouts, etc. It doesn't run the response generation logic Async.
Maybe, once you have a Context (Start-RestPSListener.ps1:80) you could pass off to a Job that does everything from Start-RestPSListener.ps1:85 to 163 so the loop that starts on Start-RestPSListener.ps1:75 could immediately get ready to "Invoke-GetContext" the next incoming (parallel) request. I dunno. I'm just guessing.
Cheers. Shaun.