AI-generated Key Takeaways
-
MessageClient.RpcService is an interface used with MessageClient.addRpcService to receive incoming RPC requests.
-
WearableListenerService is a known indirect subclass of MessageClient.RpcService and is used for receiving events from other nodes in the background.
-
The
onRequestmethod is an abstract public method that is called when an RPC request is received, providing the node ID, path, and request data. -
The
onRequestmethod is expected to return a Task containing the response to be sent back to the sender, or null if the request is not handled.
| Known Indirect Subclasses |
Used with
MessageClient.addRpcService(MessageClient.RpcService, String) to receive incoming
RPC requests.
Callers wishing to be notified of events in the background should user WearableListenerService.
Public Method Summary
| abstract Task<byte[]> |
Public Methods
public abstract Task<byte[]> onRequest (String nodeId, String path, byte[] request)
Called when an RPC request is received.
Parameters
| nodeId | node ID of the sender |
|---|---|
| path | the path at which the RPC request was received |
| request | the data associated with the RPC request |
Returns
- a future containing the response to be delivered back to the sender. null if the
request is not handled by this
MessageClient.RpcService.