APIs, concepts, guides, and more

PREMIUM FEATURE BETA

🔹 RPCs

rpc RTTask (RTTaskRequest) returns (RTTaskResponse) {};
rpc RTTaskBatch(RTTaskBatchRequest) returns (RTTaskBatchResponse) {};

🔹 Request

message RTTaskRequest {
// Common request header.
RSI.RapidServer.RequestHeader header = 1;
// The id of the task. This is the id assigned to the task when it was created.
int32 id = 2;
// The id of the task manager that the task was submitted to.
int32 manager_id = 3;
optional RTTaskConfig config = 4;
optional RTTaskAction action = 5;
}

🔹 Response

message RTTaskResponse {
// Common response header. Always check the response header for errors.
RSI.RapidServer.ResponseHeader header = 1;
// The id of the task. This is the id assigned to the task when it was created.
int32 id = 2;
// The id of the task manager that the task was submitted to.
int32 manager_id = 3;
optional RTTaskConfig config = 4;
optional RTTaskAction action = 5;
optional RTTaskInfo info = 6;
optional RTTaskStatus status = 7;
}

🔹 Batch Request and Response

message RTTaskBatchRequest {
// Common request header.
RSI.RapidServer.RequestHeader header = 1;
repeated RTTaskRequest requests = 2;
}
message RTTaskBatchResponse {
// Common response header. Always check the response header for errors.
RSI.RapidServer.ResponseHeader header = 1;
repeated RTTaskResponse responses = 2;
}

🔹 Config

message RTTaskConfig {}

🔹 Action

message RTTaskAction {
// Stop the task.
optional Stop stop = 1;
// Remove the current task from the task manager
optional Remove remove = 2;
// Reset the timing metrics for the task. (ExecutionTimeMax, Min, Mean, Last)
optional TimingReset timing_reset = 3;
// Wait until the task has executed this many times before returning.
optional ExecutionCountAbsoluteWait execution_count_absolute_wait = 4;
// Wait until the task has executed this many more times before returning.
optional ExecutionCountRelativeWait execution_count_relative_wait = 5;
message Stop {}
message Remove {}
message TimingReset {}
message ExecutionCountAbsoluteWait {
// Wait until the task has executed this many times total.
optional int64 count = 1;
// The maximum time to wait for the task to execute the specified number of times.
optional int32 timeout_ms = 2;
}
message ExecutionCountRelativeWait {
// Wait until the task has executed this many more times from the current count.
optional int64 count = 1;
// The maximum time to wait for the task to execute the specified number of times.
optional int32 timeout_ms = 2;
}
}

🔹 Info

message RTTaskInfo {
// The unique id of the task (not unique across task managers).
int32 id = 1;
// The id of the task manager that created this task.
int32 manager_id = 2;
// Constants related to the RTTask class.
Constants constants = 3;
// The parameters that were used to create the task.
RTTaskCreationParameters creation_parameters = 4;
message Constants {
// Constants related to the RTTask creation parameters.
CreationParameterConstants creation_parameters = 1;
// Constants related to the RTTask status.
StatusConstants status = 2;
message CreationParameterConstants {
// The maximum length of the library directory path.
int32 directory_length_maximum = 1;
// The maximum length of the library name and user label.
int32 name_length_maximum = 2;
// The default library name to use if none is specified.
string library_name_default = 3;
// The default task priority.
int32 priority_default = 4;
// The special value for the repeats field to indicate infinite repeats.
int32 repeat_forever = 5;
// The special value for the repeats field to indicate no repeats.
int32 repeat_none = 6;
// The default period for the task.
int32 period_default = 7;
// The default phase for the task.
int32 phase_default = 8;
// The default value for the enable_timing field.
int32 enable_timing_default = 9;
}
message StatusConstants {
// The special value for the execution count to indicate an invalid count.
int64 invalid_execution_count = 1;
// The special value for the execution time to indicate an invalid time.
uint64 invalid_execution_time = 2;
// The maximum size of the error message.
uint64 error_message_size_maximum = 3;
}
}
}

🔹 Status

message RTTaskStatus {
// The current state of the task (running, waiting, etc.)
RTTaskState state = 1;
// The number of times the task has executed.
optional int64 execution_count = 2;
// The maximum execution time of the task (in nanoseconds).
optional uint64 execution_time_max = 3;
// The minimum execution time of the task (in nanoseconds).
optional uint64 execution_time_min = 4;
// The mean execution time of the task (in nanoseconds).
optional double execution_time_mean = 5;
// The most recent execution time for the task (in nanoseconds).
optional uint64 execution_time_last = 6;
// The time since the task was last started (in nanoseconds).
optional uint64 start_time_delta_last = 7;
// The maximum time difference between the start of one task execution and the next (in nanoseconds).
optional uint64 start_time_delta_max = 8;
// The mean time difference between the start of one task execution and the next (in nanoseconds).
optional double start_time_delta_mean = 9;
// If the task is in an error state, this will contain the error message.
optional string error_message = 10;
}

🔹 Additional Messages

RTTaskStateUNKNOWN = 0;
RTTaskStateDEAD = 1;
RTTaskStateDISABLED = 2;
RTTaskStateWAITING = 3;
RTTaskStateRUNNING = 4;
}