... | ... | @@ -80,7 +80,7 @@ If you need to setup a request/response mechanism between different apps then us |
|
|
An example of a responder in a C++ application registered as *ResApp* in the Cameo server:
|
|
|
```cpp
|
|
|
try {
|
|
|
// Create the responder with name "the-responder".
|
|
|
// Create the basic responder with name "the-responder".
|
|
|
std::unique_ptr<coms::basic::Responder> responder = coms::basic::Responder::create("the-responder");
|
|
|
|
|
|
// Initialize the responder.
|
... | ... | @@ -172,13 +172,13 @@ Be careful, the responder must receive requests in a loop after *init()* otherwi |
|
|
|
|
|
Notice that the responder can reply **multiple times** for the same request. The requester must then have as many receive() calls as the number of replies.
|
|
|
|
|
|
Notice that we presented the basic responder which cannot process requests in parallel. A **single thread** must be used to receive and reply. If you need to process the requests in parallel, then you have to create some multi responders.
|
|
|
Notice that we presented the basic responder which cannot process requests in parallel. A **single thread** must be used to receive and reply. If you need to process the requests in parallel, then you have to create some multiple responders.
|
|
|
|
|
|
# Multi responders
|
|
|
# Multiple responders
|
|
|
|
|
|
To process the requests in parallel, a set of multi responders must be created. They are attached to a responder router.
|
|
|
|
|
|
An example of multi responders in a Java application:
|
|
|
An example of multiple responders in a Java application:
|
|
|
```java
|
|
|
try {
|
|
|
// Create the router.
|
... | ... | |