-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
149 additions
and
159 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Publish-Subscribe | ||
|
||
## Running The Example | ||
|
||
This example illustrates a robust publisher-subscriber communication | ||
pattern between two separate processes. The publisher sends two | ||
messages every second, each containing [`TransmissionData`]. On the | ||
receiving end, the subscriber checks for new data every second. | ||
|
||
The subscriber is printing the sample on the console whenever new data arrives. | ||
|
||
First you have to build the C++ examples: | ||
|
||
```sh | ||
cmake -S . -B target/ffi/build -DBUILD_EXAMPLES=ON | ||
cmake --build target/ffi/build | ||
``` | ||
|
||
To observe this dynamic communication in action, open two separate terminals | ||
and execute the following commands: | ||
|
||
**Terminal 1** | ||
|
||
```sh | ||
./target/ffi/build/examples/cxx/publish_subscribe/example_cxx_publish_subscribe_subscriber | ||
``` | ||
|
||
**Terminal 2** | ||
|
||
```sh | ||
./target/ffi/build/examples/cxx/publish_subscribe/example_cxx_publish_subscribe_publisher | ||
``` | ||
|
||
Feel free to run multiple instances of publisher or subscriber processes | ||
simultaneously to explore how iceoryx2 handles publisher-subscriber communication | ||
efficiently. | ||
|
||
You may hit the maximum supported number of ports when too many publisher or | ||
subscriber processes run. Take a look at the [iceoryx2 config](../../../config) to set the | ||
limits globally or at the | ||
[API of the Service builder](https://docs.rs/iceoryx2/latest/iceoryx2/service/index.html) | ||
to set them for a single service. |
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.