Explicit Request Contexts
Request contexts provide a means of sending data from client to server without having to represent this data as input parameters in the signature of an operation.
For example, consider the following definition:
struct Address
{
// ...
}
interface Person
{
string setAddress(Address a);
// ...
}
Assuming that the client has a proxy to a Person
object, it could do something along the following lines:
python
On the server side, we can extract the policy value set from the Current object to influence how the implementation of setAddress
works. For example:
For this example, the server examines the value of the context with the key "write policy"
and, if that value is "immediate"
, writes the update sent by the client straight away; if the write policy is not set or contains a value that is not recognized, the server presumably applies a more lenient write policy (such as caching the update in memory and writing it later).