Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce the polling interval for standard sessions to 2s #25404

Merged
2 commits merged into from
Nov 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Bugs Fixed

### Other Changes
- The SDK now uses a 2s polling interval when waiting for a Standard sized rendering VM. For Premium, 10s is still used.

## 1.1.1 (2021-10-07)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
/** A builder for creating a new instance of the MixedRealityRemoteRendering type. */
@ServiceClient(builder = RemoteRenderingClientBuilder.class, isAsync = true)
public final class RemoteRenderingAsyncClient {
private static final Duration DEFAULT_POLLER_TIME = Duration.ofSeconds(10);
private static final Duration CONVERSION_POLLING_INTERVAL = Duration.ofSeconds(10);
private static final Duration STANDARD_SESSION_POLLING_INTERVAL = Duration.ofSeconds(2);
private static final Duration DEFAULT_SESSION_POLLING_INTERVAL = Duration.ofSeconds(10);

private final ClientLogger logger = new ClientLogger(RemoteRenderingAsyncClient.class);

Expand Down Expand Up @@ -103,7 +105,7 @@ PollerFlux<RenderingSession, RenderingSession> beginSessionInternal(String sessi
}

return new PollerFlux<>(
DEFAULT_POLLER_TIME,
(options.getSize() == RenderingSessionSize.STANDARD) ? STANDARD_SESSION_POLLING_INTERVAL : DEFAULT_SESSION_POLLING_INTERVAL,
pollingContext -> impl.getRemoteRenderings().createSessionWithResponseAsync(accountId, sessionId, ModelTranslator.toGenerated(options), context).map(r -> ModelTranslator.fromGenerated(r.getValue())),
pollingContext -> {
Mono<RenderingSession> response = impl.getRemoteRenderings().getSessionWithResponseAsync(accountId, sessionId, context).map(r -> ModelTranslator.fromGenerated(r.getValue()));
Expand Down Expand Up @@ -334,7 +336,7 @@ PollerFlux<AssetConversion, AssetConversion> beginConversionInternal(String conv
Objects.requireNonNull(context, "'context' cannot be null.");

return new PollerFlux<>(
DEFAULT_POLLER_TIME,
CONVERSION_POLLING_INTERVAL,
pollingContext -> impl.getRemoteRenderings().createConversionWithResponseAsync(accountId, conversionId, new CreateConversionSettings(ModelTranslator.toGenerated(options)), context).map(c -> ModelTranslator.fromGenerated(c.getValue())),
pollingContext -> {
Mono<AssetConversion> response = impl.getRemoteRenderings().getConversionWithResponseAsync(accountId, conversionId, context).map(c -> ModelTranslator.fromGenerated(c.getValue()));
Expand Down