... | ... | @@ -179,7 +179,7 @@ catch (PublisherCreationException e) { |
|
|
```
|
|
|
|
|
|
Here again, *This* must have been initialized before creating the publisher. We provide a synchronization feature with the second argument of the *Publisher.create()* method: the number of subscribers can be provided. The call to *Publisher.waitForSubscribers()* is blocking until the required number of subscribers has been reached. This allows to have subscribers that will receive all the messages: The publisher is **synchronized**.
|
|
|
Default value is 0 and in that case *Publisher.waitForSubscribers()* immediately returns. Then the publisher is **not** synchronized and some messages will be lost.
|
|
|
Default value is 0 and in that case *Publisher.waitForSubscribers()* immediately returns. Then the publisher is **not** synchronized and some messages may be lost.
|
|
|
|
|
|
Let's give an example of a subcriber in C++:
|
|
|
```cpp
|
... | ... | |