Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RpcClient Update to match implementations #76

Merged
merged 2 commits into from
Mar 8, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 24 additions & 12 deletions up-l2/rpcclient.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -51,29 +51,41 @@ SPDX-License-Identifier: Apache-2.0

All link:../languages.adoc[language-specific uProtocol libraries] *MUST* declare the `RpcClient` interface with method:

`OUT Future link:../basics/umessage.adoc[UMessage] invokeMethod(IN link:../basics/uri.adoc[UUri], IN UPayload?, IN link:../basics/uattributes.adoc[UAttributes])` +
`OUT Future link:../basics/umessage.adoc[UMessage] invokeMethod(IN link:../basics/uri.adoc[UUri], IN UPayload?, IN link:../basics/.adoc[CallOptions])`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the link still needs to refer to the uattributes.adoc file?
link:../basics/uattributes.adoc[CallOptions]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed


.Parameters
[#parameters, width="80%",cols="30%,70%"]
|===

== Implementation
| Parameter
| Description

| `UUri`
| Method URI that is being invoked

Every link:../upclient.adoc[uPClient library] *MUST* implement the `RpcClient` interface.
| `CallOptions`
| Set of attributes that can be sent as part of a method invocation

|===


== Implementation

Implementations communicate to their underlining transport through the link:../up-l1/README.adoc#_utransport[uTransport Interface].

* The `UUri` and `UAttributes` passed to `invokeMethod()` *MUST* be cached non-persistent memory per call, this is to be able to complete the `Future` when the response is received from the server.
* Every link:../upclient.adoc[uPClient library] *MUST* implement the `RpcClient` interface.

* The `UUri` and `CallOptions` passed to `invokeMethod()` *MUST* be cached non-persistent memory per call, this is to be able to complete the `Future` when the response is received from the server.

* The `UPayload` passed to `invokeMethod()` *MAY* be null or empty.
* The `UPayload` passed to `invokeMethod()` *MAY* be null or empty.

* Method invocation that fails, *MUST* return exceptionally as defined by the link:../basics/error_model.adoc[uProtocol Error Model].
* Method invocation that fails, *MUST* return exceptionally as defined by the link:../basics/error_model.adoc[uProtocol Error Model].

* Cached requests must be completed exceptionally with `DEADLINE_EXCEEDED` when `UAttributes.isExpired()` is `true`. This notifies the calling context that the request has expired.
* Cached requests must be completed exceptionally with `DEADLINE_EXCEEDED` when `UAttributes.isExpired()` is `true`. This notifies the calling context that the request has expired.

* *MUST* return `INVALID_PARAMETER` for the following errors:
** `UUri` is null or empty
** `UAttributes.type() != UMessageType.REQUEST` or
`UAttributesValidator.validate()` fails (i.e. one of the UAttributes is invalid per UAttributesValidator).
* *MUST* return `INVALID_PARAMETER` if `UUri` is null or empty or `CallOptions.priority() < CS4`

* *MUST* return `ALREADY_EXISTS` if the same request already exists (i.e. same `UUri` and `UAttributes`). This is to prevent duplicate requests.
* *MUST* return `ALREADY_EXISTS` if the same request already exists (i.e. same `UUri` and `CallOptions`). This is to prevent duplicate requests.

* *MUST* complete future successfully when the response is received from the server.

Expand Down