docs: async def flush(self, request: 'Request'):
          """
          Send all queued messages.
  
          The first step is to convert all media in the stacked layers then the
          second step is to send all messages as grouped in time as possible.
          """
          from bernard.middleware import MiddlewareManager
  
          for stack in self._stacks:
              await stack.convert_media(self.platform)
  
          func = MiddlewareManager.instance().get('flush', self._flush)
          await func(request, self._stacks)