Changing RPC constants on proxy does not change the constants on the real object

Open
#213 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python

Research direction

Start in qmi/core/rpc.py by tracing the existing RPC method-call and lock request/reply handling through QMI_RpcFuture, _RpcThread, and RpcObjectManager. Add the corresponding constant request/reply flow, then update the unit tests, RPC documentation, and CHANGELOG.md. Done means changing a listed proxy constant also updates the real object's value for internal calls.

Written by the indexing model from the issue text.

Description

Description

The _rpc_constants class variable can be used in all QMI_RpcObjects to expose the class variables of the real object to its proxy object. This also means that the class variable value can be changed by doing TheProxyObjectToRealObject.variable_x = new_value, if it was defined as _rpc_constants = ["variable_x"] before the __init__ method in the real object (let's define it as RealObject(QMI_RpcObject).

The idea of the "_rpc_constants" is to stay "constant" by name, but at times we would like to change this "constant". For example when we notice some timeout becomes too short for some reason and we want to extend it without having to modify the real object itself. If we only use the proxy of the real object for the new value, it is fine. But we often need the real object's value in internal calls of the real object.

At the moment QMI lacks the forwarding of constant value change to the real object from the proxy. We need to make request and reply message classes, sending and handling of constant RPC requests in QMI_RpcFuture, and pushing and handling them in _RpcThread, and handling it in RpcObjectManager. These should be done similarly to the respective RPC method call requests and also lock requests.

Best approach is probably to create "constant" versions of QMI_XxxRpcRequest|ReplyMessage classes and see where they have been used for methods and locking, and add "constant" version of the use cases there.

Affected components

qmi.core

Files to be changed

  • qmi/core/rpc.py
  • CHANGELOG.md
  • Documentation about RPC calls -> add that constants can be changed too.
  • Unit-tests
Dominant language
Python
Stars
25
Forks
9
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from QuTech-Delft/QMI

All issues in QuTech-Delft/QMI

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.