snu-quiqcl / qiwis

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

[FEATURE] Simplify swift-call request #136

Closed kangz12345 closed 1 year ago

kangz12345 commented 1 year ago

Feature you want to implement

Just like the broadcasting in #133, I want to provide an easy way to request swift-calls. This will be implemented right after #131 and #139 is implemented.

How the feature is implemented

I want to implement a proxy to request swift-call. For example (usage):

self.swiftcall.createApp(appinfos)

To receive the result, one may use a Result object as follows:

result = self.swiftcall.createApp(appinfos)
...
if result.done:
  if result.success:
    use(result.value)
  else:
    raise result.error

However, I still have to think about the thread-safe implementation of the Result behavior.