Share via


JobRouterClient.GetWorkersAsync Method

Definition

Overloads

GetWorkersAsync(Nullable<RouterWorkerStateSelector>, String, String, Nullable<Boolean>, CancellationToken)

Retrieves existing workers.

GetWorkersAsync(String, String, String, Nullable<Boolean>, RequestContext)

[Protocol Method] Retrieves existing workers.

  • This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
  • Please try the simpler Azure.Communication.JobRouter.JobRouterClient.GetWorkersAsync(System.Nullable{System.Int32},System.Nullable{Azure.Communication.JobRouter.RouterWorkerStateSelector},System.String,System.String,System.Nullable{System.Boolean},System.Threading.CancellationToken) convenience overload with strongly typed models first.

GetWorkersAsync(Nullable<RouterWorkerStateSelector>, String, String, Nullable<Boolean>, CancellationToken)

Source:
JobRouterClient.cs
Source:
JobRouterClient.cs

Retrieves existing workers.

public virtual Azure.AsyncPageable<Azure.Communication.JobRouter.RouterWorker> GetWorkersAsync (Azure.Communication.JobRouter.RouterWorkerStateSelector? state = default, string channelId = default, string queueId = default, bool? hasCapacity = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetWorkersAsync : Nullable<Azure.Communication.JobRouter.RouterWorkerStateSelector> * string * string * Nullable<bool> * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.Communication.JobRouter.RouterWorker>
override this.GetWorkersAsync : Nullable<Azure.Communication.JobRouter.RouterWorkerStateSelector> * string * string * Nullable<bool> * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.Communication.JobRouter.RouterWorker>
Public Overridable Function GetWorkersAsync (Optional state As Nullable(Of RouterWorkerStateSelector) = Nothing, Optional channelId As String = Nothing, Optional queueId As String = Nothing, Optional hasCapacity As Nullable(Of Boolean) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As AsyncPageable(Of RouterWorker)

Parameters

state
Nullable<RouterWorkerStateSelector>

If specified, select workers by worker state.

channelId
String

If specified, select workers who have a channel configuration with this channel.

queueId
String

If specified, select workers who are assigned to this queue.

hasCapacity
Nullable<Boolean>

If set to true, select only workers who have capacity for the channel specified by channelId or for any channel if channelId not specified. If set to false, then will return all workers including workers without any capacity for jobs. Defaults to false.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Applies to

GetWorkersAsync(String, String, String, Nullable<Boolean>, RequestContext)

Source:
JobRouterClient.cs
Source:
JobRouterClient.cs

[Protocol Method] Retrieves existing workers.

  • This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
  • Please try the simpler Azure.Communication.JobRouter.JobRouterClient.GetWorkersAsync(System.Nullable{System.Int32},System.Nullable{Azure.Communication.JobRouter.RouterWorkerStateSelector},System.String,System.String,System.Nullable{System.Boolean},System.Threading.CancellationToken) convenience overload with strongly typed models first.
public virtual Azure.AsyncPageable<BinaryData> GetWorkersAsync (string state, string channelId, string queueId, bool? hasCapacity, Azure.RequestContext context);
abstract member GetWorkersAsync : string * string * string * Nullable<bool> * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
override this.GetWorkersAsync : string * string * string * Nullable<bool> * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
Public Overridable Function GetWorkersAsync (state As String, channelId As String, queueId As String, hasCapacity As Nullable(Of Boolean), context As RequestContext) As AsyncPageable(Of BinaryData)

Parameters

state
String

If specified, select workers by worker state. Allowed values: "active" | "draining" | "inactive" | "all".

channelId
String

If specified, select workers who have a channel configuration with this channel.

queueId
String

If specified, select workers who are assigned to this queue.

hasCapacity
Nullable<Boolean>

If set to true, select only workers who have capacity for the channel specified by channelId or for any channel if channelId not specified. If set to false, then will return all workers including workers without any capacity for jobs. Defaults to false.

context
RequestContext

The request context, which can override default behaviors of the client pipeline on a per-call basis.

Returns

The AsyncPageable<T> from the service containing a list of BinaryData objects. Details of the body schema for each item in the collection are in the Remarks section below.

Exceptions

Service returned a non-success status code.

Applies to