المهلات والإلغاء
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
bound waiting time.
الموضوعات المخطط لها
orTimeout(d, unit)fails withTimeoutException;completeOnTimeout(value, d, unit)supplies a default (Java 9+).cancel(true)on aCompletableFuturedoes not interrupt the running task; design tasks to check for cancellation.- Apply a deadline to the whole fan-out and per-call timeouts to each.
- A timeout does not stop the remote work; pair with client-side timeouts.
- Combine: timeout then fallback.
تفاصيل المخطط المبدئي
عرض عملي
reviews.completeOnTimeout(List.of(), 300, TimeUnit.MILLISECONDS);اختبر فهمك
Does cancel(true) interrupt the thread in a CompletableFuture?
أظهر الإجابة
No.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.