From 7b37b6fff147e76c403d803ea41720ed6989886f Mon Sep 17 00:00:00 2001 From: Vigen Issahhanjan Date: Thu, 19 Nov 2020 14:03:25 -0800 Subject: Internal change PiperOrigin-RevId: 343365350 Change-Id: If6d9f95b1407f88100f2a394d3ba2535579e147c Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2597836 Reviewed-by: Ryan Keane Commit-Queue: Ryan Keane --- cast/cast_core/api/runtime/runtime_service.proto | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cast/cast_core/api/runtime/runtime_service.proto b/cast/cast_core/api/runtime/runtime_service.proto index 708d741a..5c8c8da3 100644 --- a/cast/cast_core/api/runtime/runtime_service.proto +++ b/cast/cast_core/api/runtime/runtime_service.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package cast.runtime; +import "google/protobuf/duration.proto"; import "cast/cast_core/api/common/service_info.proto"; option optimize_for = LITE_RUNTIME; @@ -20,6 +21,11 @@ service RuntimeService { // If both app_id and cast_session_id are omitted, the current, "foreground" // application is stopped. rpc StopApplication(StopApplicationRequest) returns (StopApplicationResponse); + + // Requests runtime to send a heartbeat in a stream. The use of server-side + // streaming allows Core to know for sure that runtime is still running. In + // case of a crash, the gRPC stream will error with UNAVAILABLE error. + rpc Heartbeat(HeartbeatRequest) returns (stream HeartbeatResponse); } message LaunchApplicationRequest { @@ -46,3 +52,11 @@ message StopApplicationResponse { // If stop application was successful, the Cast session ID that was stopped. string cast_session_id = 2; } + +message HeartbeatRequest { + // Period between two heartbeat responses. The Core will wait for double of + // this time to avoid network glitches. The minimum value is 5 seconds. + google.protobuf.Duration heartbeat_period = 1; +} + +message HeartbeatResponse {} -- cgit v1.2.3