-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #606 from elfenpiff/iox2-429-request-response-serv…
…ice-builder [#429] request response service builder
- Loading branch information
Showing
36 changed files
with
2,795 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Request-Response | ||
|
||
## Classes Involved In ActiveRequest to ActiveResponse Stream Communication | ||
|
||
User has send request to the server and receives a stream of responses. | ||
|
||
```mermaid | ||
classDiagram | ||
Client "1" --> "1" DataSegment: stores request payload | ||
Server "1" --> "1" DataSegment: stores response payload | ||
Client "1" --> "1..*" ActiveRequest | ||
Server "1" --> "1..*" ActiveResponse | ||
ActiveRequest "1" --> "1" ZeroCopyConnection: receive response | ||
ActiveResponse "1" --> "1" ZeroCopyConnection: send response | ||
``` | ||
|
||
## Sending Request: Client View | ||
|
||
```mermaid | ||
sequenceDiagram | ||
User->>+Client: loan | ||
Client-->>-User: RequestMut | ||
create participant RequestMut | ||
User->>RequestMut: write_payload | ||
destroy RequestMut | ||
User->>+RequestMut: send | ||
RequestMut-->>-User: ActiveRequest | ||
create participant ActiveRequest | ||
User->>+ActiveRequest: receive | ||
ActiveRequest-->>-User: Response | ||
create participant Response | ||
User->>Response: read_payload | ||
destroy ActiveRequest | ||
User->>ActiveRequest: drop | ||
``` | ||
|
||
## Responding: Server View | ||
|
||
```mermaid | ||
sequenceDiagram | ||
User->>+Server: receive | ||
Server-->>-User: ActiveResponse | ||
create participant ActiveResponse | ||
User->ActiveResponse: read_payload | ||
User->>+ActiveResponse: loan | ||
ActiveResponse-->>-User: ResponseMut | ||
create participant ResponseMut | ||
User->>ResponseMut: write_payload | ||
destroy ResponseMut | ||
User->>ResponseMut: send | ||
destroy ActiveResponse | ||
User->>ActiveResponse: drop | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Copyright (c) 2025 Contributors to the Eclipse Foundation | ||
# | ||
# See the NOTICE file(s) distributed with this work for additional | ||
# information regarding copyright ownership. | ||
# | ||
# This program and the accompanying materials are made available under the | ||
# terms of the Apache Software License 2.0 which is available at | ||
# https://www.apache.org/licenses/LICENSE-2.0, or the MIT license | ||
# which is available at https://opensource.org/licenses/MIT. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 OR MIT | ||
|
||
load("@rules_rust//rust:defs.bzl", "rust_binary") | ||
|
||
rust_binary( | ||
name = "server", | ||
srcs = [ | ||
"server.rs", | ||
], | ||
deps = [ | ||
"//iceoryx2:iceoryx2", | ||
"//examples/rust:examples-common", | ||
], | ||
) | ||
|
||
rust_binary( | ||
name = "client", | ||
srcs = [ | ||
"client.rs", | ||
], | ||
deps = [ | ||
"//iceoryx2:iceoryx2", | ||
"//examples/rust:examples-common", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Request-Response |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright (c) 2025 Contributors to the Eclipse Foundation | ||
// | ||
// See the NOTICE file(s) distributed with this work for additional | ||
// information regarding copyright ownership. | ||
// | ||
// This program and the accompanying materials are made available under the | ||
// terms of the Apache Software License 2.0 which is available at | ||
// https://www.apache.org/licenses/LICENSE-2.0, or the MIT license | ||
// which is available at https://opensource.org/licenses/MIT. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
|
||
use examples_common::TransmissionData; | ||
use iceoryx2::prelude::*; | ||
|
||
fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
let node = NodeBuilder::new().create::<ipc::Service>()?; | ||
|
||
let service = node | ||
.service_builder(&"My/Funk/ServiceName".try_into()?) | ||
.request_response::<u64, TransmissionData>() | ||
.open_or_create()?; | ||
|
||
drop(service); | ||
println!("exit"); | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright (c) 2025 Contributors to the Eclipse Foundation | ||
// | ||
// See the NOTICE file(s) distributed with this work for additional | ||
// information regarding copyright ownership. | ||
// | ||
// This program and the accompanying materials are made available under the | ||
// terms of the Apache Software License 2.0 which is available at | ||
// https://www.apache.org/licenses/LICENSE-2.0, or the MIT license | ||
// which is available at https://opensource.org/licenses/MIT. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
|
||
use examples_common::TransmissionData; | ||
use iceoryx2::prelude::*; | ||
|
||
fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
let node = NodeBuilder::new().create::<ipc::Service>()?; | ||
|
||
let service = node | ||
.service_builder(&"My/Funk/ServiceName".try_into()?) | ||
.request_response::<u64, TransmissionData>() | ||
.open_or_create()?; | ||
|
||
drop(service); | ||
println!("exit"); | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.