def METHOD_NAME(self, header: Any, size: int) -> Generator[memoryview, None, None]:
    alloc_handle, payload_shm = self._get_buf_for_writing(size)
    yield payload_shm
    self.q.put((cloudpickle.dumps(header), 'bytes', alloc_handle))