old_contents: from abc import abstractmethod
  
  from aioworkers.core.base import AbstractNamedEntity
  
  
  class AbstractStorageReadOnly(AbstractNamedEntity):
      @abstractmethod
      async def get(self, key):
          raise NotImplementedError()
  
  
  class AbstractStorageWriteOnly(AbstractNamedEntity):
      @abstractmethod
      async def set(self, key, value):
          raise NotImplementedError()
  
  
  class AbstractStorage(AbstractStorageReadOnly, AbstractStorageWriteOnly):
      pass
  
  
  class AbstractListedStorage(AbstractStorage):
      @abstractmethod
      async def list(self):
          raise NotImplementedError()
  
      @abstractmethod
      async def length(self):
          raise NotImplementedError()
  
  
  class AbstractExpiryStorage(AbstractStorage):
      @abstractmethod
      async def expiry(self, key, expiry):
          raise NotImplementedError()
  
new_contents: from abc import abstractmethod
  
  from aioworkers.core.base import AbstractNamedEntity
  
  
  class AbstractStorageReadOnly(AbstractNamedEntity):
      @abstractmethod
      async def get(self, key):
          raise NotImplementedError()
  
  
  class AbstractStorageWriteOnly(AbstractNamedEntity):
      @abstractmethod
      async def set(self, key, value):
          raise NotImplementedError()
  
  
  class AbstractStorage(AbstractStorageReadOnly, AbstractStorageWriteOnly):
      async def copy(self, key_source, storage_dest, key_dest):
          data = await self.get(key_source)
          await storage_dest.set(key_dest, data)
          return data is None
  
      async def move(self, key_source, storage_dest, key_dest):
          result = await self.copy(key_source, storage_dest, key_dest)
          if result:
              await self.set(key_source, None)
          return result
  
  
  class AbstractListedStorage(AbstractStorage):
      @abstractmethod
      async def list(self):
          raise NotImplementedError()
  
      @abstractmethod
      async def length(self):
          raise NotImplementedError()
  
  
  class AbstractExpiryStorage(AbstractStorage):
      @abstractmethod
      async def expiry(self, key, expiry):
          raise NotImplementedError()
  
subject: copy & move in storage