async def flush(self, request: '<STR_LIT>'):
from bernard.middleware import MiddlewareManager<EOL>for stack in self._stacks:<EOL><INDENT>await stack.convert_media(self.platform)<EOL><DEDENT>func = MiddlewareManager.instance().get('<STR_LIT>', self._flush)<EOL>await func(request, self._stacks)<EOL>
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.