feat(browser): stream bounded live session updates (#26)
This commit is contained in:
@@ -8,6 +8,7 @@ internal enum TestClientMode
|
||||
{
|
||||
Host,
|
||||
Browse,
|
||||
Watch,
|
||||
Join,
|
||||
}
|
||||
|
||||
@@ -34,6 +35,8 @@ internal sealed class TestClientOptions
|
||||
internal bool Script { get; init; }
|
||||
internal bool Json { get; init; }
|
||||
internal bool ExitAfterEcho { get; init; }
|
||||
internal bool ExerciseReconnect { get; init; }
|
||||
internal bool ExerciseReset { get; init; }
|
||||
}
|
||||
|
||||
internal sealed class TestClientParseResult
|
||||
@@ -63,6 +66,7 @@ internal static class TestClientOptionParser
|
||||
Usage:
|
||||
rendezvous-test-client host [options]
|
||||
rendezvous-test-client browse [options]
|
||||
rendezvous-test-client watch [options]
|
||||
rendezvous-test-client join [options]
|
||||
|
||||
Common options:
|
||||
@@ -88,6 +92,11 @@ internal static class TestClientOptionParser
|
||||
--run-seconds NUMBER Stop after 1-86400 seconds
|
||||
--exit-after-echo Stop after an authenticated ping/echo/ack exchange
|
||||
|
||||
Watch options:
|
||||
--run-seconds NUMBER Stop after 1-86400 seconds
|
||||
--exercise-reconnect Disconnect after an update and verify ordered replay
|
||||
--exercise-reset Corrupt the snapshot cursor and verify reset/refresh
|
||||
|
||||
Join options:
|
||||
--listing UUID Join an exact listing; otherwise browse/select
|
||||
|
||||
@@ -129,6 +138,8 @@ internal static class TestClientOptionParser
|
||||
bool script = false;
|
||||
bool json = false;
|
||||
bool exitAfterEcho = false;
|
||||
bool exerciseReconnect = false;
|
||||
bool exerciseReset = false;
|
||||
HashSet<string> seen = new(StringComparer.Ordinal);
|
||||
|
||||
for (int index = 1; index < args.Length; index++)
|
||||
@@ -138,7 +149,8 @@ internal static class TestClientOptionParser
|
||||
{
|
||||
return TestClientParseResult.Help();
|
||||
}
|
||||
if (option is "--script" or "--json" or "--exit-after-echo")
|
||||
if (option is "--script" or "--json" or "--exit-after-echo"
|
||||
or "--exercise-reconnect" or "--exercise-reset")
|
||||
{
|
||||
if (!seen.Add(option))
|
||||
{
|
||||
@@ -147,6 +159,8 @@ internal static class TestClientOptionParser
|
||||
script |= option == "--script";
|
||||
json |= option == "--json";
|
||||
exitAfterEcho |= option == "--exit-after-echo";
|
||||
exerciseReconnect |= option == "--exercise-reconnect";
|
||||
exerciseReset |= option == "--exercise-reset";
|
||||
continue;
|
||||
}
|
||||
if (!option.StartsWith("--", StringComparison.Ordinal)
|
||||
@@ -279,8 +293,11 @@ internal static class TestClientOptionParser
|
||||
return TestClientParseResult.Failure("One or more game, environment, region, build, or display values violate v1 limits.");
|
||||
}
|
||||
if (listingId.HasValue && mode != TestClientMode.Join
|
||||
|| runSeconds.HasValue && mode != TestClientMode.Host
|
||||
|| runSeconds.HasValue && mode is not (TestClientMode.Host or TestClientMode.Watch)
|
||||
|| exitAfterEcho && mode != TestClientMode.Host
|
||||
|| exerciseReconnect && mode != TestClientMode.Watch
|
||||
|| exerciseReset && mode != TestClientMode.Watch
|
||||
|| exerciseReconnect && exerciseReset
|
||||
|| metadata.Count > 0 && mode != TestClientMode.Host
|
||||
|| dedicatedFallback is not null && mode != TestClientMode.Host
|
||||
|| seen.Contains("--publisher-credential-env") && mode != TestClientMode.Host
|
||||
@@ -316,6 +333,8 @@ internal static class TestClientOptionParser
|
||||
Script = script,
|
||||
Json = json,
|
||||
ExitAfterEcho = exitAfterEcho,
|
||||
ExerciseReconnect = exerciseReconnect,
|
||||
ExerciseReset = exerciseReset,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user