subiquity icon indicating copy to clipboard operation
subiquity copied to clipboard

Background work to prepare move to v2 storage API in the client

Open ogayot opened this issue 1 year ago • 1 comments

Going forward, the client storage/filesystem controller should perform all of the storage actions by making async calls to the API. These calls will be implemented using coroutines functions that will call aiohttp.

At the start, these new coroutine functions will override the methods from the manipulator. However, the functions defined by the manipulator are not coroutines functions so there is a mismatch.

Move the needed functions to coroutine functions so that we can properly override them with coroutine functions.

This PR introduces:

  • a way to connect a signal to a coroutine connect_async_signal. This is similar in essence to what urwid.connect_signal except that it creates a background task to execute the coroutine
  • a way to declare storage actions as coroutine functions.

NOTE: This may feel like a wasted effort to move manipulator functions to coroutines functions since eventually, the client will not inherit from the manipulator anymore. However, it is necessary to implement the client using async functions so this should allow us to make a simpler transition.

ogayot avatar Jun 19 '24 12:06 ogayot

I was going to respond to each comment but I think perhaps it's best for me to wait until you ping again?

mwhudson avatar Jun 21 '24 00:06 mwhudson