4.1.9 Getting Available Runspaces of the Server's RunspacePool
The typical sequence, with respect to the PowerShell Remoting Protocol for getting the available Runspaces count of the server's RunspacePool is described in the following table:
|
Step |
Client |
Direction |
Server |
|---|---|---|---|
|
1 |
The RunspacePool is in the Opened state on the client. |
|
|
|
2 |
The client constructs an integer identifier to represent the message to be sent, and stores it in the RunspacePool's CI table (section 3.1.1.2.5). The client constructs a GET_AVAILABLE_RUNSPACES message (section 2.2.2.11) and sends it using wxf:Send message (section 3.1.5.3.11) targeted to the RunspacePool. |
> |
|
|
3 |
The client sends a wxf:Receive message (section 3.1.5.3.7) to the server if none is currently pending for this RunspacePool. |
> |
|
|
4 |
The client processes the RUNSPACE_AVAILABILITY message (section 2.2.2.8) and removes the corresponding entry from the RunspacePool's CI table (section 3.1.1.2.5). |
< |
The server gets the available number of runspaces (section 3.2.1.2.10). The server sends a wxf:SendResponse message (section 3.2.5.3.6) to the client. The server constructs a RUNSPACE_AVAILABILITY message (section 2.2.2.8) and sends it to the client using wxf:ReceiveResponse message (section 3.2.5.3.8). |
|
5 |
The client can send the response to the higher-layer as needed. |
|
|