> **Experimental**
>
> `@aws-cdk/aws-gamelift-alpha` is an [**experimental**](https://docs.aws.amazon.com/cdk/api/stability.html) (alpha) package: its API may change in any release, without a major version bump.
# PlayerLatencyPolicy

The queue setting that determines the highest latency allowed for individual players when placing a game session.

When a latency policy is in force, a game session cannot be placed with any fleet in a Region where a player reports latency higher than the cap.

Latency policies are only enforced when the placement request contains player latency information.

- Stability: [Experimental](https://docs.aws.amazon.com/cdk/api/stability.html)
- Source: [`lib/game-session-queue.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/@aws-cdk/aws-gamelift-alpha/lib/game-session-queue.ts#L81)

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as gamelift_alpha from '@aws-cdk/aws-gamelift-alpha';
import * as cdk from 'aws-cdk-lib';
const playerLatencyPolicy: gamelift_alpha.PlayerLatencyPolicy = {
  maximumIndividualPlayerLatency: cdk.Duration.minutes(30),

  // the properties below are optional
  policyDuration: cdk.Duration.minutes(30),
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_gamelift_alpha as gamelift_alpha
import aws_cdk as cdk

player_latency_policy = gamelift_alpha.PlayerLatencyPolicy(
    maximum_individual_player_latency=cdk.Duration.minutes(30),

    # the properties below are optional
    policy_duration=cdk.Duration.minutes(30)
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.gamelift.alpha.*;
import software.amazon.awscdk.*;

PlayerLatencyPolicy playerLatencyPolicy = PlayerLatencyPolicy.builder()
        .maximumIndividualPlayerLatency(Duration.minutes(30))

        // the properties below are optional
        .policyDuration(Duration.minutes(30))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.AWS.GameLift.Alpha
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.GameLift.Alpha;
using Amazon.CDK;

var playerLatencyPolicy = new PlayerLatencyPolicy {
    MaximumIndividualPlayerLatency = Duration.Minutes(30),

    // the properties below are optional
    PolicyDuration = Duration.Minutes(30)
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdkgameliftalpha/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import gamelift_alpha "github.com/aws/aws-cdk-go/awscdkgameliftalpha"
import "github.com/aws/aws-cdk-go/awscdk"

playerLatencyPolicy := &PlayerLatencyPolicy{
	MaximumIndividualPlayerLatency: cdk.Duration_Minutes(jsii.Number(30)),

	// the properties below are optional
	PolicyDuration: cdk.Duration_*Minutes(jsii.Number(30)),
}
```

## Properties

- `maximumIndividualPlayerLatency`: [Duration](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Duration.html) (required) — The maximum latency value that is allowed for any player, in milliseconds.

  All policies must have a value set for this property.

- `policyDuration`: [Duration](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Duration.html) — The length of time, in seconds, that the policy is enforced while placing a new game session.

  **Default:** the policy is enforced until the queue times out.
