A way to make template code more easible to read, is to expose the actions as methods on the service proxy object.
Synchronous action invocations
# Seemless way
result = myservice.install(reinstall=True)
# Current way
result = myservice.schedule_action("install", args=dict(reinstall=True)).wait(die=True).result
Asynchronous actions invocations
# Seemless way
task = myservice.install_async(reinstall=True)
result = task.get_result() # Blocks and might throw exception (eco)
# Current way
task = myservice.schedule_action("install", args=dict(reinstall=True))
task.wait()
if task.state == 'error':
raise task.eco
else:
result = task.result
Issue migrated from [https://api.github.com/repos/zero-os/0-robot/issues/186](), opened by @FastGeert
A way to make template code more easible to read, is to expose the actions as methods on the service proxy object.
Synchronous action invocations
Asynchronous actions invocations