diff options
Diffstat (limited to 'protocol/events.proto')
-rw-r--r-- | protocol/events.proto | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/protocol/events.proto b/protocol/events.proto index f543577..9b3d676 100644 --- a/protocol/events.proto +++ b/protocol/events.proto @@ -20,12 +20,8 @@ import "ui.proto"; -//TODO: extended ui updates subscriptions proto part (ui data messages on timer, e.t.c.) - -// event subscription part begin //TODO: rework -//TODO: download state chage events message subscription_download_ui_info { @@ -49,6 +45,11 @@ enum SUBSCRIPTION_TYPE { S_DOWNLOAD_DELETED = 4; } +enum SUBSCRIPTION_MODE { + S_MODE_EVENT = 0; + S_MODE_REPEATED = 1; +} + //download state subscription for download state changes (can be module defined) enum SUBSCRIPTION_DOWNLOAD_STATE { S_D_STARTED = 0; @@ -56,15 +57,18 @@ enum SUBSCRIPTION_DOWNLOAD_STATE { } message subscription_download_state_change { - repeated SUBSCRIPTION_DOWNLOAD_STATE states = 1; + repeated SUBSCRIPTION_DOWNLOAD_STATE states = 1; //list of states on which event should be sent } //information about subscription request message client_event_subscription_request { required SUBSCRIPTION_TYPE type = 1; //type must be set - required string module_name = 2; //module name must be set, can be "" for all installed modules supported subscription type - optional subscription_download_ui_info download_ui_info = 3; - optional subscription_download_state_change download_state_change = 4; + required SUBSCRIPTION_MODE mode = 2; //mode must be set + required string module_name = 3; //module name must be set, can be "" for all installed modules supported subscription type + optional int64 interval = 4 [default = 5000]; //event fire interval in milliseconds, valid for repeated event mode + optional bool one_time = 5 [default = false]; //is event should fire only once ? + optional subscription_download_ui_info download_ui_info = 6; + optional subscription_download_state_change download_state_change = 7; } @@ -73,8 +77,8 @@ message client_event_subscription_request { //1. can be customized to unsubscript from few aubscriptions at once message client_event_unsubscription_request { - required SUBSCRIPTION_TYPE type = 1; - required string module_name = 2; + required SUBSCRIPTION_TYPE type = 1; //type must be set + required string module_name = 2; //module name must be set, can be "" for all installed modules supported subscription type optional unsubscription_download_ui_info ui_info = 3; optional subscription_download_state_change download_state_change = 4; //reusing defined structure to avoid code duplication } @@ -104,4 +108,3 @@ message server_event_unsubscription_reply { optional int32 subscription_id = 1002; } -//event subscription part end |