... | ... | @@ -176,8 +176,10 @@ Another useful communication pattern is the publish/subscribe pattern. It allows |
|
|
```java
|
|
|
try {
|
|
|
// Create the publisher with name "the-publisher".
|
|
|
// Set the number of subscribers to 1.
|
|
|
Publisher publisher = Publisher.create("the-publisher", 1);
|
|
|
Publisher publisher = Publisher.create("the-publisher");
|
|
|
|
|
|
// Set the number of subscribers to wait to 1.
|
|
|
publisher->setWaitForSubscribers(1);
|
|
|
|
|
|
// Synchronize with the subscriber(s). Wait for the subscriber to connect.
|
|
|
publisher.init();
|
... | ... | |