Skip to content

Commit

Permalink
Digital Twin Graph
Browse files Browse the repository at this point in the history
  • Loading branch information
ashbeitz committed May 4, 2024
1 parent f3b11fd commit 1f132a8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions core/module/digital_twin_graph/src/digital_twin_graph_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ impl DigitalTwinGraph for DigitalTwinGraphImpl {
let provider_uri = provider_endpoint_info.uri.clone();
let instance_id = provider_endpoint_info.context.clone();

let tx = Arc::clone(&self.tx);
let tx = self.tx.clone();
let mut rx = tx.subscribe();

let client_result = RequestClient::connect(provider_uri.clone()).await;
Expand Down Expand Up @@ -326,9 +326,10 @@ impl DigitalTwinGraph for DigitalTwinGraphImpl {
let provider_uri = provider_endpoint_info.uri.clone();
let instance_id = provider_endpoint_info.context.clone();

let tx = Arc::clone(&self.tx);
let tx = self.tx.clone();
let mut rx = tx.subscribe();

// Connect to the provider where we will send the ask to get the instance's value.
let client_result = RequestClient::connect(provider_uri.clone()).await;
if client_result.is_err() {
return Err(tonic::Status::internal("Unable to connect to the provider."));
Expand All @@ -338,6 +339,7 @@ impl DigitalTwinGraph for DigitalTwinGraphImpl {
// Note: The ask id must be a universally unique value.
let ask_id = Uuid::new_v4().to_string();

// Create the targeted payload. Note: The member path is not used when the operation is GET.
let targeted_payload = TargetedPayload {
instance_id: instance_id.clone(),
member_path: member_path.clone(),
Expand Down Expand Up @@ -447,7 +449,7 @@ impl DigitalTwinGraph for DigitalTwinGraphImpl {
let provider_uri = provider_endpoint_info.uri.clone();
let instance_id = provider_endpoint_info.context.clone();

let tx = Arc::clone(&self.tx);
let tx = self.tx.clone();
let mut rx = tx.subscribe();

let client_result = RequestClient::connect(provider_uri.clone()).await;
Expand Down
4 changes: 2 additions & 2 deletions docs/design/modules/digital_twin_graph/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ provide a consumer with the best interaction experience. They can be used as bui
delivers a much better interaction experience. In the future, Ibeji may support multiple facades and the user can select the one that they prefer to use.

This design specifies a graph-based facade, which will be named the Digital Twin Graph Service. With this facade, the digital twin will be represented as a
graph of digital twin entities whose arcs represent the relationships between those entities. Instance ids will be used to refer to entities.
graph of digital twin entities whose arcs represent the relationships between those entities. Instance IDs will be used to refer to entities.

Please note that Ibeji is only intended for use on an IoT edge device. It is not intended for use in the cloud. The data that it manages can be
transferred to the cloud, through components like [Eclipse Freyja](https://github.com/eclipse-ibeji/freyja).
Expand All @@ -28,7 +28,7 @@ represents the digital twin.

Ibeji's In-vehicle Digital Twin Service needs some adjustments to support the Digital Twin Graph Service. We will introduce a modified form of the service under the name "Digital Twin Registry" and keep the existing functionality intact under the original In-vehicle Digital Twin Service.

The Managed Subscriber Service is an optional service that provides integration with Agemo. It has been included in the component diagram for completeness sake.
The Managed Subscriber Service is an optional service that provides integration with Agemo. The Managed Subscriber Service has been included in the component diagram for completeness' sake.

![Component Diagram](diagrams/digital_twin_graph_component.svg)

Expand Down

0 comments on commit 1f132a8

Please sign in to comment.