The Request/Reply communication pattern consists of two roles:
Server (or LocalServer), local server participant
This class is instantiated in the service-providing RSB process. Provided methods are registered by name and signature.RemoteServer, remote server participant
This class is instantiated in the service-using RSB process. Each RemoteServer instance has one or more corresponding Server instances, potentially in different processes, that provide the service in question. Client code calls methods on the RemoteServer instance which cause methods of a Service instance to be called and perform the requested task.
For example:
Important
If a single service is provided by more than one server, requests will be processed in all servers, but the client will only receive one, arbitrarily selected, reply.
Conversely, if service is not provided by any server, the request part of method calls is performed, but a reply is never received. This situation is indistinguishable from a server which takes an infinitely long time to process request and can therefore not be detected by the caller. However, timeouts can be used handle absent and slow servers uniformly.
Conceptually, the Server instance is the root of the following object tree:
Conceptually, the RemoteServer instance is the root of the following object tree:
TODO: include examples or link to tutorial?
Language | File(s) |
---|---|
C++ | “0.12” branch of https://code.cor-lab.org/git/rsb.git.cpp at src/rsb/patterns/ |
Java | “0.12” branch of https://code.cor-lab.org/git/rsb.git.java at src/rsb/patterns/ |
Python | “0.12” branch of https://code.cor-lab.org/git/rsb.git.python at rsb/patterns/ |
Common Lisp | “0.12” branch of https://code.cor-lab.org/git/rsb.git.cl at src/patterns/request-reply |