```py class PDFView(FormView): form_class = ConvertPdf template_name = "pdf_convert.html" context = {"title": "Convert PDF"}, view_is_async = True async def post(self, request, *args, **kwargs): form_class = self.get_form_class() form = self.get_form(form_class) if form.is_valid(): file = request.FILES.get("file", None) if file is not None: frmt = form.cleaned_data["format"].lower() print(file.temporary_file_path()) try: handler = ConvertHandler(file.read(), "pdf", frmt, write=False) await handler.write_async() except BadFile: context = self.context.copy() context["error"] = "Invalid file" return render(request, self.template_name, context) user = await get_user_from_request(request) job_id = await Manager.add_task( convert_pdf_func, { "session_key": request.session.session_key, "user_pk": user.pk, "is_auth": user.is_authenticated, "timeout": 10 }, handler) messages.add_message(request, messages.SUCCESS, job_id) return redirect("GetResults", permanent=True) return HttpResponse("Internal error while converting") return HttpResponse("ERROR, this will be fixed soon") async def get(self, request, *args, **kwargs): return render(request, self.template_name, context={"title": "Convert PDF", "form": self.form_class},) ``` my issue is ```py handler = ConvertHandler(file.read(), "pdf", frmt, write=False) ``` where file.read() isnt async and if i have 100 files uplaoded at once it can cause hickups so i thought about writing somthing like that
You should dispatch that to a thread