Beispiel #1
0
 /// <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));
 }
Beispiel #2
0
 /// <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));
 }
Beispiel #3
0
 /// <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));
 }
Beispiel #4
0
 /// <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();