snu-quiqcl / qiwis

QuIqcl Widget Integration Software
MIT License
5 stars 2 forks source link

[FEATURE] System request protocol (swift-call) #119

Closed kangz12345 closed 1 year ago

kangz12345 commented 1 year ago

Feature you want to implement

Providing a way to call system features for apps. The targeted features in this issue are:

How the feature is implemented

I come up with two strategies:

  1. Reserve a special channel name, e.g. "swift", and handling the messages broadcast to that channel.
  2. Add a new dedicated signal in BaseApp.

We decided to go with the second option because it is not necessary for the other apps to hear the system requests.

kangz12345 commented 1 year ago

I think the option 1 is better since it seems more general, e.g., the other apps can also hear that an app is requesting a special operation to swift system.

BECATRUE commented 1 year ago

I think the option 1 is better since it seems more general, e.g., the other apps can also hear that an app is requesting a special operation to swift system.

I agree with you.

I will implement these functions according to your suggestion.

kangz12345 commented 1 year ago

As we said before, let's make a dedicated signal for the system request. However, I think we have to decide the protocol first. My suggestion is:

{
  "feature": "createApp", # same as the actual method name
  "args": {"foo": 0, "bar": True}, # method arguments as keyword argument only
}
kangz12345 commented 1 year ago

Please check this before you implement further! @BECATRUE