### Get uSubscription CLI Usage Help Source: https://github.com/eclipse-uprotocol/up-subscription-rust/blob/main/README.md This command displays the help information for the `up-subscription-cli` tool. It lists the available command-line options and their descriptions, helping users understand how to configure and run the service via the CLI. ```bash up-subscription-cli -h ``` -------------------------------- ### Run uSubscription Service with Rust Library Source: https://github.com/eclipse-uprotocol/up-subscription-rust/blob/main/README.md This snippet demonstrates how to instantiate a UTransport implementation and then call `USubscriptionServce::run()` to start the uSubscription service. It requires a `USubscriptionConfiguration` object and returns a `USubscriptionStopper` for graceful shutdown. The UTransport is used for sending notifications and responses. ```rust let transport: impl UTransport = ...; // Instantiate your UTransport implementation let configuration = USubscriptionConfiguration { transport: transport.clone(), /* other options */ }; let stopper = USubscriptionService::run(configuration); // Use stopper to shut down the service later ``` -------------------------------- ### Run uSubscription CLI with Docker Compose Source: https://github.com/eclipse-uprotocol/up-subscription-rust/blob/main/README.md This command uses `docker-compose` to build and run the `up-subscription-cli` service within a Docker container. This is a convenient way to get a running uSubscription service, especially for demonstration purposes. Network settings may need adjustment for production environments. ```bash docker-compose up ``` -------------------------------- ### Build and Run uSubscription CLI with Zenoh Transport Source: https://github.com/eclipse-uprotocol/up-subscription-rust/blob/main/README.md This command builds and runs the `up-subscription-cli` using Cargo, enabling the `zenoh` feature for transport. It demonstrates passing command-line arguments for transport (`-t zenoh`), address (`-a usubscription.local`), and verbose output (`-v`). ```bash cargo run --features zenoh -- -t zenoh -a usubscription.local -v ``` -------------------------------- ### Build uSubscription CLI Docker Image Source: https://github.com/eclipse-uprotocol/up-subscription-rust/blob/main/README.md This command builds a Docker image for the `up-subscription-cli` from the project root. The image is tagged as `up-subscription` and can be used for containerized deployments of the uSubscription service. ```bash docker build -t up-subscription . ``` -------------------------------- ### Block Diagram of USubscription Service Architecture Source: https://github.com/eclipse-uprotocol/up-subscription-rust/blob/main/README.md This block diagram illustrates the architectural components of the USubscription service, including UTransport, RpcServer, various handlers, and the subscription/notification managers. It shows the flow of communication between these components. ```mermaid block-beta columns 3 transport(("UTransport")):3 space:3 block:usubscription:3 uSubscription/RpcServer end space:3 block:handlers:3 SubscribeHandler RegisterForNotificationsHandler etcHandler end space:3 subscription_manager:1 space:1 notification_manager:1 space:3 task("remote_(un)subscribe") space:2 transport--"rpc call"-->uSubscription/RpcServer uSubscription/RpcServer-->SubscribeHandler uSubscription/RpcServer-->RegisterForNotificationsHandler uSubscription/RpcServer-->etcHandler SubscribeHandler--"mpsc channel"-->subscription_manager SubscribeHandler--"mpsc channel"-->notification_manager RegisterForNotificationsHandler--"mpsc channel"-->notification_manager subscription_manager--"spawn"-->task classDef smaller font-size:small; class SubscribeListener,UnsubscribeListener,etcListener smaller class task smaller ``` -------------------------------- ### Sequence Diagram for Subscription Request Flow Source: https://github.com/eclipse-uprotocol/up-subscription-rust/blob/main/README.md This sequence diagram visualizes the interaction flow when a client requests a subscription. It details the steps from the UTransport sending a SubscriptionRequest to the USubscription service processing it, interacting with managers, and sending back a SubscriptionResponse. ```mermaid sequenceDiagram actor UTransport box WhiteSmoke USUbscription Service participant usubscription RpcServer participant subscribe handler participant subscription_manager participant notification_manager end UTransport-->>+usubscription RpcServer: SubscriptionRequest usubscription RpcServer->>subscribe handler: handle_request() activate subscribe handler subscribe handler->>subscription_manager: send(SubscriptionEvent::AddSubscription) activate subscription_manager subscription_manager-->>subscription_manager: validate and store subscription info alt is local topic subscription_manager-->>usubscription: send(SubscriptionStatus::SUBSCRIBED) else is remote topic subscription_manager-->>usubscription: send(SubscriptionStatus::SUBSCRIBE_PENDING) create participant remote_subscribe subscription_manager-->>remote_subscribe: spawn() deactivate subscription_manager remote_subscribe-->>UTransport: send remote SubscriptionRequest UTransport-->>remote_subscribe: remote SubscriptionResponse # remote_subscribe->>+notification_manager: send(NotificationEvent::StateChange) # notification_manager-->>UTransport: send(Update) to default notification channel # loop Every custom notification # notification_manager-->>UTransport: send(Update) custom channel # end # notification_manager-->>-remote_subscribe: send(()) activate subscription_manager destroy remote_subscribe remote_subscribe-->>subscription_manager: send(RemoteSubscriptionEvent::RemoteTopicStateUpdate) subscription_manager-->>subscription_manager: update subscription info end deactivate subscription_manager subscribe handler->>usubscription RpcServer: SubscriptionResponse usubscription RpcServer-->>UTransport: SubscriptionResponse deactivate subscribe handler usubscription->>+notification_manager: send(NotificationEvent::StateChange) notification_manager-->>UTransport: send(Update) to default notification channel loop Every custom notification notification_manager-->>UTransport: send(Update) custom channel end notification_manager-->>-usubscription: send(()) ``` -------------------------------- ### Configure VS Code Coverage Gutters for Rust Source: https://github.com/eclipse-uprotocol/up-subscription-rust/blob/main/CONTRIBUTING.md These JSON settings configure the 'Coverage Gutters' VS Code extension to display code coverage information for Rust projects. It specifies the base directory for coverage and the file name containing the coverage data generated by tools like 'tarpaulin'. ```json { "coverage-gutters.coverageBaseDir": "**", "coverage-gutters.coverageFileNames": [ "target/tarpaulin/lcov.info" ] } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.