RequestReply » History » Version 1

J. Moringen, 07/26/2011 04:41 PM
initial version

1 1 J. Moringen
h1. Request/Reply Communication
2 1 J. Moringen
3 1 J. Moringen
h2. Introduction
4 1 J. Moringen
5 1 J. Moringen
The Request/Reply communication pattern is provided by pair of classes called @Server@ and @RemoteServer@ or similar:
6 1 J. Moringen
* @Server@: This class is instantiated in the service-providing RSB process. Provided methods are registered by name and signature.
7 1 J. Moringen
* @RemoteServer@: This class is instantiated in the service-using RSB process. Each @RemoteServer@ instance has one or more corresponding @Server@ instance, 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.
8 1 J. Moringen
9 1 J. Moringen
h2. Mapping to Event Concepts
10 1 J. Moringen
11 1 J. Moringen
h3. @Server@ Representation
12 1 J. Moringen
13 1 J. Moringen
Conceptually, the @Server@ instance is the root of the following object graph:
14 1 J. Moringen
15 1 J. Moringen
* @Server@
16 1 J. Moringen
** Scope
17 1 J. Moringen
** Method
18 1 J. Moringen
*** Name
19 1 J. Moringen
*** Request Listener
20 1 J. Moringen
Scope: @/SERVER-SCOPE/request/METHOD-NAME/@
21 1 J. Moringen
*** Reply Informer
22 1 J. Moringen
Scope: @/SERVER-SCOPE/reply/METHOD-NAME/@
23 1 J. Moringen
** more methods
24 1 J. Moringen
25 1 J. Moringen
h3. @RemoteServer@ Representation
26 1 J. Moringen
27 1 J. Moringen
Conceptually, the @RemoteServer@ instance is the root of the following object graph:
28 1 J. Moringen
29 1 J. Moringen
* @RemoteServer@
30 1 J. Moringen
** Scope
31 1 J. Moringen
** Method
32 1 J. Moringen
*** Name
33 1 J. Moringen
*** Request Informer
34 1 J. Moringen
Scope: @/SERVER-SCOPE/request/METHOD-NAME/@
35 1 J. Moringen
*** Reply Listener
36 1 J. Moringen
Scope: @/SERVER-SCOPE/reply/METHOD-NAME/@
37 1 J. Moringen
*** A collection of in-progress method calls
38 1 J. Moringen
** more methods
39 1 J. Moringen
40 1 J. Moringen
h3. Communication
41 1 J. Moringen
42 1 J. Moringen
# Client code calls a method on a @RemoteServer@ instance
43 1 J. Moringen
# The request informer of the method publishes an @Event@ containing
44 1 J. Moringen
#* The argument of the method call as payload
45 1 J. Moringen
#* A [[Events|user-info]] item with key @ServerRequestId@ and the string representation of a UUID as value
46 1 J. Moringen
# A record containing the above UUID is created for the method call
47 1 J. Moringen
# The call blocks until a reply event is received (see below)
48 1 J. Moringen
# The request listener of the method in a corresponding @Server@ instance receives the @Event@
49 1 J. Moringen
# The event is dispatched to a handler for processing
50 1 J. Moringen
# After processing, the reply informer of the method in the @Server@ sends an @Event@ containing
51 1 J. Moringen
#* The result of the processing as payload
52 1 J. Moringen
#* A user-info item with key @ServerRequestId@ and the value received in the user-info item of the same key in the request @Event@
53 1 J. Moringen
# The reply listener of the method in the @RemoteServer@ receives the reply @Event@
54 1 J. Moringen
# The call record is located using the value of the user-info item with key @ServerRequestId@
55 1 J. Moringen
# The blocking call is notified an returns the payload of the reply event
56 1 J. Moringen
57 1 J. Moringen
h2. Implementations
58 1 J. Moringen
59 1 J. Moringen
|_.Language   |_.File(s)                                            |
60 1 J. Moringen
| C++         | source:trunk/cpp/core/src/rsb/patterns              |
61 1 J. Moringen
| Java        | source:trunk/java/core/src/rsb/patterns             |
62 1 J. Moringen
| Python      | source:"trunk/python/core/rsb/patterns/__init__.py" |
63 1 J. Moringen
| Common Lisp | source:trunk/cl/cl-rsb/src/patterns                 |