The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in IETF BCP14 (RFC2119 & RFC8174)
SPDX-FileCopyrightText: 2023 Contributors to the Eclipse Foundation Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. SPDX-FileType: DOCUMENTATION SPDX-License-Identifier: Apache-2.0
RpcClient
defines a common, language specific interface for method invocation to allow the auto-generation of client-side & server-side code per-language (SDK) in lieu of per platform.
Term | Description |
---|---|
|
Input parameter |
|
Output parameter |
|
Input/output parameter |
|
Parameter passed by reference |
|
Parameter is optional |
|
Language specific mechanism to access the result of asynchronous operations, ex. |
All language-specific uProtocol libraries MUST declare the RpcClient
interface with method:
OUT Future UMessage invokeMethod(IN UUri, IN UPayload?, IN CallOptions)
Parameter |
Description |
|
Method URI that is being invoked |
|
Set of attributes that can be sent as part of a method invocation |
Implementations communicate to their underlining transport through the uTransport Interface.
-
Every uPClient library MUST implement the
RpcClient
interface. -
The
UUri
andCallOptions
passed toinvokeMethod()
MUST be cached non-persistent memory per call, this is to be able to complete theFuture
when the response is received from the server. -
The
UPayload
passed toinvokeMethod()
MAY be null or empty. -
Method invocation that fails, MUST return exceptionally as defined by the uProtocol Error Model.
-
Cached requests must be completed exceptionally with
DEADLINE_EXCEEDED
whenUAttributes.isExpired()
istrue
. This notifies the calling context that the request has expired. -
MUST return
INVALID_PARAMETER
ifUUri
is null or empty orCallOptions.priority() < CS4
-
MUST return
ALREADY_EXISTS
if the same request already exists (i.e. sameUUri
andCallOptions
). This is to prevent duplicate requests. -
MUST complete future successfully when the response is received from the server.