diff --git a/Cargo.toml b/Cargo.toml index ba73a79..b138e33 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ documentation = "https://docs.rs/axiston" [workspace.dependencies] axiston-rt-jsvm = { path = "./crates/jsvm", version = "0.1.0" } -axiston-rt-schema = { path = "./crates/schema", version = "0.1.0", features = ["server"] } +axiston-rt-schema = { path = "./crates/schema", version = "0.1.0" } axiston-rt-server = { path = "./crates/server", version = "0.1.0" } axiston-rt-task = { path = "./crates/task", version = "0.1.0" } diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b8e0a56 --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +# Makefile for client & server GRPC Generation +# https://github.com/hyperium/tonic + +# Environment Variables +SCHEMA_OUTPUT = ./crates/schema/generated/ + +.PHONY: clean +clean: ## Deletes the output directory. + $(call print-info, "Cleaning project...") + rm -f $(SCHEMA_OUTPUT) + $(call print-success, "Project cleaned.") diff --git a/crates/schema/Cargo.toml b/crates/schema/Cargo.toml index aa3043d..571d081 100644 --- a/crates/schema/Cargo.toml +++ b/crates/schema/Cargo.toml @@ -21,6 +21,8 @@ rustdoc-args = ["--cfg", "docsrs"] path = "lib.rs" [features] +default = ["client", "server"] + # Enables or disables gRPC client code generation. client = [] # Enables or disables gRPC server code generation. diff --git a/crates/schema/lib.rs b/crates/schema/lib.rs index 7afd028..1e3864a 100644 --- a/crates/schema/lib.rs +++ b/crates/schema/lib.rs @@ -2,22 +2,55 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![doc = include_str!("./README.md")] -//! ### Examples -//! -//! ```rust -//! fn main() {} -//! ``` +pub mod json { + //! Includes files generated by `prost`. + + pub mod schema { + //! Includes files generated by `prost`. + //! Built from `jsonschema.proto`. + + include!("./generated/rt.json.schema.rs"); + } + + pub mod value { + //! Includes files generated by `prost`. + //! Built from `jsonvalue.proto`. + + include!("./generated/rt.json.value.rs"); + } +} pub mod instance { //! Includes files generated by `prost`. //! Built from `instance.proto`. - include!("./generated/instance.rs"); + include!("./generated/rt.instance.rs"); } pub mod registry { //! Includes files generated by `prost`. //! Built from `registry.proto`. - include!("./generated/registry.rs"); + include!("./generated/rt.registry.rs"); +} + +pub mod entity { + //! Includes files generated by `prost`. + //! Built from `entity.proto`. + + include!("./generated/rt.entity.rs"); +} + +pub mod request { + //! Includes files generated by `prost`. + //! Built from `request.proto`. + + include!("./generated/rt.request.rs"); +} + +pub mod response { + //! Includes files generated by `prost`. + //! Built from `response.proto`. + + include!("./generated/rt.response.rs"); } diff --git a/crates/schema/protobuf/entity.proto b/crates/schema/protobuf/entity.proto new file mode 100644 index 0000000..8f954be --- /dev/null +++ b/crates/schema/protobuf/entity.proto @@ -0,0 +1,82 @@ +syntax = "proto3"; + +import "google/protobuf/timestamp.proto"; +import "google/protobuf/empty.proto"; +import "internal/jsonschema.proto"; +import "internal/jsonvalue.proto"; + +package rt.entity; + +// Describes service details. +message Service { + // Unique identifier for the service. + string service_id = 1; + // Name of the service (e.g., Google Email). + string name = 21; + // Unique identifier for the service's icon. + string icon = 22; + // Brief description of the service. + string description = 4; +} + +// Describes action or trigger details. +message Entity { + string entity_id = 1; + string service_id = 2; + + string name = 21; + string icon = 22; + + // Input specifications for this entity. + repeated Input inputs = 7; + // Output specifications for this entity. + repeated Output outputs = 8; + // Possible error codes this entity might return. + repeated Error errors = 9; +} + +// Describes secrets required by a entity. +message Secret { + // Unique identifier for the secret. + string id = 1; + // Name of the secret (e.g., "API Key"). + string name = 2; + // Description of the secret. + string description = 3; + // Whether the secret is mandatory for the service. + bool is_required = 4; +} + +// Describes the input requirements for an entity. +message Input { + // Name of the input (e.g., "recipient"). + string name = 1; + // Data type of the input (e.g., "string", "int"). + rt.json.schema.JsonSchema data_type = 2; + // Description of the input. + string description = 3; + // Whether this input is mandatory. + bool is_required = 4; + // Default value for the input, if applicable. + rt.json.value.JsonValue default_value = 5; +} + +// Describes the output generated by an entity. +message Output { + // Name of the output (e.g., "message_id"). + string name = 1; + // Data type of the output (e.g., "string", "int"). + rt.json.schema.JsonSchema data_type = 2; + // Description of the output. + string description = 3; +} + +// Describes potential errors an entity can return. +message Error { + // Unique error code (e.g., "ERR_401"). + string code = 1; + // Human-readable error message. + string message = 2; + // Description or guidance for resolving the error. + string resolution = 3; +} diff --git a/crates/schema/protobuf/event/request.proto b/crates/schema/protobuf/event/request.proto new file mode 100644 index 0000000..920ec71 --- /dev/null +++ b/crates/schema/protobuf/event/request.proto @@ -0,0 +1,99 @@ +syntax = "proto3"; + +import "google/protobuf/timestamp.proto"; +import "google/protobuf/duration.proto"; + +package rt.request; + +// Request to open a connection to the event bus. +// Indicates the Gateway is ready accept events. +message OpenRequest { + // Token for authenticating the Gateway. + string authentication_token = 3; + // Required runtime capabilities. + repeated string runtime_capabilities = 4; + // Preferred communication protocols. + repeated string preferred_protocols = 5; + + // Constraints on resources for the task. + optional ResourceLimits resource_limits = 26; +} + +// Request to submit a task for execution by the Runtime. +message ExecuteRequest { + // Unique identifier for the task. + string task_id = 1; + // Custom task parameters as key-value pairs. + map task_fields = 2; + // Sensitive task-specific data (e.g., API keys). + map task_secrets = 3; + + // Priority level of the task (higher is more important). + optional int32 priority = 23; + // Deadline for the task completion. + optional google.protobuf.Timestamp deadline = 24; + // Whether task dependencies are cached. + optional bool cache_deps = 25; + + // Policy for retrying failed tasks. + optional RetryPolicy retry_policy = 31; + // Policy for handling task timeouts. + optional TimeoutPolicy timeout_policy = 32; +} + +// Request to close the connection, preventing the Runtime from accepting new tasks. +message CloseRequest { + // Force immediate closure without waiting. + // Ignores pending tasks (from this connection) before closing. + optional bool force_close = 2; + // Reason for closing the connection. + optional string reason = 3; + // Require acknowledgment before closing. + optional bool ack_required = 4; +} + +// Policy for retrying failed tasks. +message RetryPolicy { + // Maximum number of retry attempts. + uint32 max_retries = 1; + // Base delay between consecutive retries. + google.protobuf.Duration base_backoff = 2; + // Multiplier for exponential backoff. + optional double exponential_multiplier = 3; + // Maximum delay between consecutive retries. + google.protobuf.Duration max_backoff = 4; +} + +// Policy for handling task timeouts. +message TimeoutPolicy { + // Maximum execution time allowed for the task. + google.protobuf.Duration execution_timeout = 1; + // Whether to forcibly terminate the task on timeout. + bool terminate_on_timeout = 2; + // Action to take on timeout (e.g., "retry", "terminate"). + TimeoutAction timeout_action = 3; + // Extra time given before final termination after timeout. + optional google.protobuf.Duration grace_period = 4; + // Frequency of checking for timeout conditions. + optional google.protobuf.Duration monitor_interval = 5; +} + +// Lists all of possible timeout actions. +enum TimeoutAction { + // Default value, action unspecified. + TIMEOUT_ACTION_UNSPECIFIED = 0; + // Task is considered to be failed. Retry the task. + TIMEOUT_ACTION_RETRY = 1; + // Task is considered to be failed. Do not retry the task. + TIMEOUT_ACTION_TERMINATE = 2; +} + +// Limits runtime resources. +message ResourceLimits { + // Maximum used CPU percentage. + uint32 max_cpu_percent = 1; + // Maximum used RAM in MB. + uint32 max_ram_mb = 2; + // Maximum used disk in MB. + uint64 max_disk_mb = 3; +} diff --git a/crates/schema/protobuf/event/response.proto b/crates/schema/protobuf/event/response.proto new file mode 100644 index 0000000..d8e4de5 --- /dev/null +++ b/crates/schema/protobuf/event/response.proto @@ -0,0 +1,131 @@ +syntax = "proto3"; + +import "google/protobuf/timestamp.proto"; +import "google/protobuf/duration.proto"; + +package rt.response; + +// Start execution response message. +message OpenResponse { + google.protobuf.Timestamp started = 1; + optional google.protobuf.Duration estimate = 2; +} + +// Response message containing the result of task execution. +message ExecuteResponse { + // Unique identifier for the task. + string task_id = 1; + // Task's return code indicating success or failure. + uint32 return_code = 2; + + // When the task started. + google.protobuf.Timestamp start_time = 4; + // When the task completed. + google.protobuf.Timestamp end_time = 5; + // Total time taken for execution. + google.protobuf.Duration execution_time = 6; +} + +// Response to acknowledge that no new tasks will be accepted. +message CloseResponse { + // Indicates if it's safe to terminate the connection. + bool is_safe_to_close = 1; + // Number of tasks still in the queue or running. + int32 remaining_tasks = 3; +} + +// Intermediate task status notification sent by the runtime. +message NotifyResponse { + oneof status_info { + // Details for the "waiting" status. + WaitingStatus waiting = 21; + // Details for the "pre-running" status. + PreRunningStatus pre_running = 22; + // Details for the "running" status. + RunningStatus running = 23; + // Details for the "post-running" status. + PostRunningStatus post_running = 24; + } +} + +// Waiting status information. +message WaitingStatus { + // Number of tasks ahead in the queue. + uint32 tasks_before = 1; + // Total number of tasks in the queue. + uint32 queue_size = 2; + // Maximum capacity of the queue. + uint32 queue_capacity = 3; + // Estimated wait time before task starts. + google.protobuf.Duration wait_time = 4; +} + +// Pre-running status information. +message PreRunningStatus { + // Size (in bytes) of data to serialize. + uint64 input_bytes = 1; + // Version of the Runtime. + uint64 runtime_version = 2; + // File system type used ("virtual" or "physical"). + FileSystemType fs_type = 3; + // Whether task dependencies are cached. + bool cache_deps = 4; + // Allocated runtime resources. + ResourceAllocated resource = 5; +} + +// Running status information. +message RunningStatus { + // Identifier of the thread running this task. + int32 thread_id = 8; + // Estimated remaining run time. + google.protobuf.Duration run_time = 1; + // Current progress checkpoint. + int32 checkpoint = 6; +} + +// Post-running status information. +message PostRunningStatus { + // Task's return code indicating success or failure. + uint32 return_code = 1; + // Total bytes read during task execution. + uint64 read_bytes = 2; + // Total bytes written during task execution. + uint64 written_bytes = 3; + // Size (in bytes) of data to deserialize. + uint64 output_bytes = 4; + // Peak or maximum recorded resource usage. + ResourceUsage resource_usage = 5; +} + +// Represents the type of filesystem used. +enum FileSystemType { + // Default value, should not be used. + FILESYSTEM_UNSPECIFIED = 0; + // Virtual filesystem (e.g., in-memory, network-based). + FILESYSTEM_VIRTUAL = 1; + // Physical filesystem (e.g., SSD, HDD). + FILESYSTEM_PHYSICAL = 2; +} + +// Allocated runtime resources. +message ResourceAllocated { + // Allocated CPU cores. + uint32 allocated_cpu_cores = 21; + // Allocated RAM in megabytes. + uint32 allocated_ram_mb = 22; + // Allocated HDD in megabytes. + uint32 allocated_disk_mb = 23; +} + +// Peak or maximum recorded resource usage. +message ResourceUsage { + // Peak CPU usage as a percentage. + uint32 peak_cpu_percent = 21; + // Peak RAM usage in megabytes. + uint32 peak_ram_mb = 22; + // Peak disk usage in megabytes. + uint32 peak_disk_mb = 23; + // Peak GPU usage as a percentage. + uint32 peak_gpu_percent = 24; +} diff --git a/crates/schema/protobuf/instance.proto b/crates/schema/protobuf/instance.proto index bfc5d7e..caee5ec 100644 --- a/crates/schema/protobuf/instance.proto +++ b/crates/schema/protobuf/instance.proto @@ -2,15 +2,17 @@ syntax = "proto3"; import "google/protobuf/timestamp.proto"; import "google/protobuf/duration.proto"; +import "event/request.proto"; +import "event/response.proto"; -package instance; +package rt.instance; -// The message format for sending events. +// Describes the message format for sending events. message EventRequest { // The unique ID of the request message. - string id = 1; + uint32 request_id = 1; // The unique ID of the message group. - string group = 2; + uint32 group_id = 2; // When the event was recv by the gateway. google.protobuf.Timestamp recv = 3; @@ -19,23 +21,23 @@ message EventRequest { // The content of the message. oneof payload { - // Step 1.1 - OpenRequest Open = 10; - // Step 2.2 - NotifyResponse AckNotify = 11; - // Step 3.2 - CloseResponse AckClose = 12; + // Step 1.1: Gateway requests to open a connection. + rt.request.OpenRequest open_request = 11; + // Step 2.1: Gateway submits a task for the execution. + rt.request.ExecuteRequest execute_request = 12; + // Step 3.1: Gateway requests to close the connection. + rt.request.CloseRequest close_request = 13; } } -// The message format for receiving events. +// Describes the message format for receiving events. message EventResponse { + // The unique ID of the request message. + uint32 request_id = 1; // The unique ID of the response message. - uint32 id = 1; + uint32 response_id = 2; // The unique ID of the message group. - uint32 group = 2; - // The unique ID of the request message. - uint32 reply = 3; + uint32 group_id = 3; // When the event was recv by the runtime. google.protobuf.Timestamp recv = 4; @@ -44,50 +46,64 @@ message EventResponse { // The content of the message. oneof payload { - // Step 1.2 - OpenResponse AckOpen = 10; - // Step 2.1 - NotifyRequest Notify = 11; - // Step 3.1 - CloseRequest Close = 12; + // Step 1.2: Runtime acknowledges that the connection is open. + rt.response.OpenResponse open_response = 11; + // Step 2.2: Runtime notifies the Gateway about the task's status change. + rt.response.NotifyResponse notify_response = 12; + // Step 2.3: Runtime responds with the result of executing the task. + rt.response.ExecuteResponse execute_response = 13; + // Step 3.2: Runtime confirms the connection is closed. + rt.response.CloseResponse close_response = 14; } } -// Start execution request message. -message OpenRequest { - string task = 1; - - map fields = 2; - map secrets = 3; -} - -// Start execution response message. -message OpenResponse { - google.protobuf.Timestamp started = 1; - optional google.protobuf.Duration estimate = 2; -} +// Requests service status and metrics. +message StatusRequest { + // Forces retrieval of the latest metrics. + optional bool current = 11; + // Includes detailed metrics in the response. + optional bool verbose = 12; -message NotifyRequest { - string task = 1; + // Sliding window length (used by metrics). + optional int32 window = 21; } -message NotifyResponse {} - -message CloseRequest { - string task = 1; +// Details service status and performance metrics. +message StatusResponse { + // Task-related metrics: + + // Number of tasks waiting in the queue to be processed. + int64 tasks_waiting = 11; + // Number of tasks currently being processed. + int64 tasks_running = 12; + // Total number of tasks that have been completed successfully. + int64 tasks_done = 13; + + // Time-related metrics: + + // Total time the service has been running since startup (human-readable format). + google.protobuf.Duration total_uptime = 21; + // Cumulative time the service has spent idle (not processing any tasks). + google.protobuf.Duration total_idle_time = 22; + // Cumulative time the service has been overwhelmed and tasks have been queued due to load. + google.protobuf.Duration total_wait_time = 23; + + // Average processing time for tasks in the most recent window. + google.protobuf.Duration avg_recent_time = 31; + // Overall average processing time since the service started. + google.protobuf.Duration avg_total_time = 32; + // Average processing time for tasks that failed. + google.protobuf.Duration avg_failure_time = 33; + // Average processing time for tasks that succeeded. + google.protobuf.Duration avg_success_time = 34; } -message CloseResponse {} - -message StatusRequest {} - -message StatusResponse {} - +// Provides runtime instance management. service Instance { - // TODO. + // Retrieves detailed service health and performance metrics. rpc Status(StatusRequest) returns (StatusResponse); - // Bidirectional event streaming RPC for continuous communication + // Provides a bidirectional event streaming RPC for continuous communication // between the gateway (as a client) and the runtime (as a server). - rpc Connect(stream EventRequest) returns (stream EventResponse); + rpc Bus(stream EventRequest) returns (stream EventResponse); } diff --git a/crates/schema/protobuf/internal/jsonschema.proto b/crates/schema/protobuf/internal/jsonschema.proto new file mode 100644 index 0000000..78b02be --- /dev/null +++ b/crates/schema/protobuf/internal/jsonschema.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; + +import "google/protobuf/empty.proto"; + +package rt.json.schema; + +// Represents any valid `JSON` schema type. +message JsonSchema { + // Specifies that the value field can hold one of several possible types. + oneof value { + // Represents a string type, e.g. `"hello"` or `"world"`. + google.protobuf.Empty string_type = 1; + // Represents an integer type e.g. `4` or `138253`. + google.protobuf.Empty integer_type = 2; + // Represents a float type e.g. `2.6` or `6.0004`. + google.protobuf.Empty float_type = 3; + // Represents a boolean type i.e. `true`/`false`. + google.protobuf.Empty boolean_value = 4; + // Represents a null value i.e. `null`. + google.protobuf.Empty null_value = 5; + // Represents an object type e.g. `{ "key": "value" }`. + JsonSchemaObject object_value = 6; + // Represents an array type e.g. `["key", "value"]`. + JsonSchemaArray array_value = 7; + } +} + +// Defines the schema for a `JSON` object, which consists of key-value pairs. +message JsonSchemaObject { + // Represents the map of the field names and their types. + map fields = 1; +} + +// Defines the schema for a `JSON` array, which contains a list of elements. +message JsonSchemaArray { + // Represents the types of the elements in the array. + repeated JsonSchema elements = 1; +} diff --git a/crates/schema/protobuf/internal/jsonvalue.proto b/crates/schema/protobuf/internal/jsonvalue.proto new file mode 100644 index 0000000..d4c6825 --- /dev/null +++ b/crates/schema/protobuf/internal/jsonvalue.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; + +import "google/protobuf/empty.proto"; + +package rt.json.value; + +// Represents different types of `JSON` values. +message JsonValue { + // Specifies that the value field can hold one of several possible types. + oneof value { + // Represents a string type, e.g. `"hello"` or `"world"`. + string string_type = 1; + // Represents an integer type e.g. `4` or `138253`. + int32 integer_type = 2; + // Represents a float type e.g. `2.6` or `6.0004`. + float float_type = 3; + // Represents a boolean type i.e. `true`/`false`. + bool boolean_value = 4; + // Represents a null value i.e. `null`. + google.protobuf.Empty null_value = 5; + // Represents an object type e.g. `{ "key": "value" }`. + JsonObject object_value = 6; + // Represents an array type e.g. `["key", "value"]`. + JsonArray array_value = 7; + } +} + +// Contains the values of a map of `JSON` values. +message JsonObject { + // Contains the map of the field names and their values. + map fields = 1; +} + +// Contains the values of an array of `JSON` values. +message JsonArray { + // Contains the values of the elements in the array. + repeated JsonValue items = 1; +} diff --git a/crates/schema/protobuf/registry.proto b/crates/schema/protobuf/registry.proto index 5edd854..4de490f 100644 --- a/crates/schema/protobuf/registry.proto +++ b/crates/schema/protobuf/registry.proto @@ -1,43 +1,62 @@ syntax = "proto3"; import "google/protobuf/timestamp.proto"; -// import "google/protobuf/empty.proto"; +import "google/protobuf/empty.proto"; +import "entity.proto"; -package registry; +package rt.registry; -message Service { - string id = 1; - string name = 2; - string icon = 3; -} - -message Entity { - string id = 1; - string name = 2; - string icon = 3; -} - -message CheckRequest {} - -message CheckResponse {} - -// The message format for requesting for the registry content. +// Retrieves the registry details. message RegistryRequest {} -// The message format for responding with the registry content. +// Contains the registry details. message RegistryResponse { - google.protobuf.Timestamp created = 2; - google.protobuf.Timestamp updated = 3; + // Total number of registered services. + uint32 total_services = 1; + // Total number of registered actions. + uint32 total_actions = 2; + // Total number of registered triggers. + uint32 total_triggers = 3; + + // Registry registration startup timestamp. + google.protobuf.Timestamp first_updated_at = 4; + // Registry registration shutdown timestamp. + google.protobuf.Timestamp last_updated_at = 5; + + // List of registered services. + repeated rt.entity.Service services = 11; + // List of registered actions. + repeated rt.entity.Entity actions = 12; + // List of registered triggers. + repeated rt.entity.Entity triggers = 13; +} + +message SearchRequest { + uint32 query_id = 11; + // Search term to match all registered entities to. + string query = 12; + // Filter by associated tags. + repeated string tags = 13; + + // Limit on the number of search results. + uint32 max_results = 21; + // Include deprecated entities in search results if true. + bool include_deprecated = 22; +} - repeated Service services = 11; - repeated Entity triggers = 12; - repeated Entity actions = 13; +message SearchResponse { + // Entities matching the search criteria. + repeated rt.entity.Entity matching_entities = 1; + // Total number of matches found. + uint32 total_matches = 2; + // True if results were truncated due to max_results. + bool truncated = 3; } service Registry { // Comprehensive collection of available tasks and their metadata. - rpc Registry(registry.RegistryRequest) returns (registry.RegistryResponse); + rpc Registry(RegistryRequest) returns (RegistryResponse); - // Authentication, authorization, and health checks. - rpc Check(registry.CheckRequest) returns (registry.CheckResponse); + // Searches for specific services in the registry. + rpc Search(SearchRequest) returns (SearchResponse); } diff --git a/crates/server/Cargo.toml b/crates/server/Cargo.toml index ced13f4..56f9157 100644 --- a/crates/server/Cargo.toml +++ b/crates/server/Cargo.toml @@ -36,5 +36,5 @@ prost = { workspace = true } tonic-types = { workspace = true } prost-types = { workspace = true } -tower = { version = "0.4", features = ["full"] } -tower-http = { version = "0.5", features = ["full"] } +tower = { workspace = true } +tower-http = { workspace = true } diff --git a/crates/server/handler/instance.rs b/crates/server/handler/instance.rs index b4b3024..cdfe6bc 100644 --- a/crates/server/handler/instance.rs +++ b/crates/server/handler/instance.rs @@ -1,5 +1,5 @@ use axiston_rt_schema::instance::instance_server::{Instance, InstanceServer}; -use axiston_rt_schema::instance::{EventRequest, EventResponse}; +use axiston_rt_schema::instance::{EventRequest, EventResponse, StatusRequest, StatusResponse}; use futures::stream::BoxStream; use futures::StreamExt; use tokio::sync::mpsc; @@ -29,16 +29,28 @@ impl InstanceService { #[tonic::async_trait] impl Instance for InstanceService { - type ConnectStream = BoxStream<'static, Result>; + async fn status( + &self, + request: Request, + ) -> Result, Status> { + todo!() + } + + type BusStream = BoxStream<'static, Result>; - async fn connect( + async fn bus( &self, request: Request>, - ) -> Result, Status> { + ) -> Result, Status> { let mut request = request.into_inner(); - let (tx, rx) = mpsc::channel(128); - tokio::spawn(async move { while let Some(event) = request.next().await {} }); + // TODO: Create a new queue. + + let _handle = tokio::spawn(async move { + while let Some(event) = request.next().await { + let _ = event; + } + }); let rx = ReceiverStream::new(rx); Ok(Response::new(Box::pin(rx))) diff --git a/crates/server/service/config.rs b/crates/server/service/app_config.rs similarity index 100% rename from crates/server/service/config.rs rename to crates/server/service/app_config.rs diff --git a/crates/server/service/cache.rs b/crates/server/service/cache.rs deleted file mode 100644 index d90179c..0000000 --- a/crates/server/service/cache.rs +++ /dev/null @@ -1,6 +0,0 @@ -//! TODO. -//! - -pub struct RegistryCache { - pub triggers: (), -} diff --git a/crates/server/service/mod.rs b/crates/server/service/mod.rs index 46d2b0d..a9bd65e 100644 --- a/crates/server/service/mod.rs +++ b/crates/server/service/mod.rs @@ -1,9 +1,9 @@ //! TODO. //! -pub use crate::service::config::{AppBuilder, AppConfig}; +pub use crate::service::app_config::{AppBuilder, AppConfig}; -mod config; +mod app_config; mod instance; mod registry; diff --git a/crates/task/lib.rs b/crates/task/lib.rs index a8d3aab..f80fc2b 100644 --- a/crates/task/lib.rs +++ b/crates/task/lib.rs @@ -33,3 +33,6 @@ pub enum Error { /// /// [`Result`]: std::result::Result pub type Result = std::result::Result; + +// TODO: Is there any real reason to make a different between action and trigger? +// Make trigger dynamically determined if the action returns a single boolean.