تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تؤدي الطلبات المتعددة بواجهة برمجة التطبيقات إلى ظهور عمليات طويلة الأمد. تتتبّع هذه الحالة الحالة
لوظيفة يتم تنفيذها على مدار فترة زمنية طويلة، كإجراء
حظر استدعاء إجراء عن بُعد (RPC) غير مرغوب فيه.
فئة OperationFuture
وتتمثل الطريقة الأكثر وضوحًا للتفاعل مع LROs في
صف واحد (OperationFuture). في حال استخدام هذا، يُرجى التأكد من عدم تلف عميل الخدمة.
صيغة غير محبَّذة:
privatevoiddoSomething(){OperationFuture<Empty,Empty>future=startLongRunningOperation(jobName);future.get();}privateOperationFuture<Empty,Empty>startLongRunningOperation(StringjobToStart)throwsUnsupportedEncodingException{try(OfflineUserDataJobServiceClientofflineUserDataJobServiceClient=googleAdsClient.getLatestVersion().createOfflineUserDataJobServiceClient()){// Issues an asynchronous request to run the offline user data job for executing// all added operations.returnofflineUserDataJobServiceClient.runOfflineUserDataJobAsync(jobToStart);}}
تاريخ التعديل الأخير: 2024-10-14 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2024-10-14 (حسب التوقيت العالمي المتفَّق عليه)"],[[["Several API calls initiate long-running operations, tracked by jobs that execute over time, making blocking RPCs undesirable."],["The `OperationFuture` class facilitates interaction with long-running operations, but requires the service client to remain active during its usage."],["Directly using `OperationFuture` within a method without ensuring the service client's lifespan can lead to issues."],["It's recommended to utilize `OperationFuture` within the scope of the service client, as demonstrated in the \"Recommended\" code example, to prevent premature client destruction."]]],[]]