/// <summary> /// Construct with details of Google Cloud Run. /// </summary> /// <param name="cloudRunDetails">Details of Google Cloud Run.</param> public Platform(CloudRunPlatformDetails cloudRunDetails) { CloudRunDetails = GaxPreconditions.CheckNotNull(cloudRunDetails, nameof(cloudRunDetails)); }
/// <summary> /// Creates poll settings from the given expiration, delay and call settings. /// </summary> /// <param name="expiration">The expiration to use in order to know when to stop polling. Must not be null.</param> /// <param name="delay">The delay between RPC calls. Must be non-negative.</param> public PollSettings(Expiration expiration, TimeSpan delay) { Expiration = GaxPreconditions.CheckNotNull(expiration, nameof(expiration)); Delay = GaxPreconditions.CheckNonNegativeDelay(delay, nameof(delay)); }
/// <summary> /// Construct with details of Google Container (Kubernetes) Engine. /// </summary> /// <param name="gkeDetails">Details of Google Container (Kubernetes) Engine.</param> public Platform(GkePlatformDetails gkeDetails) { GkeDetails = GaxPreconditions.CheckNotNull(gkeDetails, nameof(gkeDetails)); }
/// <summary> /// Simulates a synchronous delay by calling <see cref="IScheduler.Delay(TimeSpan, CancellationToken)"/> on /// <paramref name="scheduler"/>, and unwrapping any exceptions generated (typically cancellation). /// </summary> /// <param name="scheduler">The scheduler to use for the sleep operation.</param> /// <param name="delay">Time to sleep for. Must not be negative.</param> /// <param name="cancellationToken">The cancellation token that will be watched during the sleep operation.</param> /// <exception cref="OperationCanceledException">The cancellation token was cancelled during the sleep.</exception> public static void Sleep(this IScheduler scheduler, TimeSpan delay, CancellationToken cancellationToken) => GaxPreconditions.CheckNotNull(scheduler, nameof(scheduler)) .Delay(delay, cancellationToken) .WaitWithUnwrappedExceptions();