completable-future पर टैग किए गए जवाब

4
कंप्लीटटेबल फ़ॉइल | तत्पश्चात
मैं thenApply() और के बीच के अंतर के आसपास अपना सिर नहीं मिला सकता thenCompose()। तो, क्या कोई वैध उपयोग का मामला दे सकता है? जावा डॉक्स से: thenApply(Function<? super T,? extends U> fn) एक नया रिटर्न देता CompletionStageहै, जब यह चरण सामान्य रूप से पूरा होता है, इस चरण …

1
पूरा करने योग्य सम्मिलित हों बनाम प्राप्त करें
बीच क्या अंतर है CompletableFuture.get()और CompletableFuture.join()? नीचे मेरा कोड है: List<String> process() { List<String> messages = Arrays.asList("Msg1", "Msg2", "Msg3", "Msg4", "Msg5", "Msg6", "Msg7", "Msg8", "Msg9", "Msg10", "Msg11", "Msg12"); MessageService messageService = new MessageService(); ExecutorService executor = Executors.newFixedThreadPool(4); List<String> mapResult = new ArrayList<>(); CompletableFuture<?>[] fanoutRequestList = new CompletableFuture[messages.size()]; int count = …
हमारी साइट का प्रयोग करके, आप स्वीकार करते हैं कि आपने हमारी Cookie Policy और निजता नीति को पढ़ और समझा लिया है।
Licensed under cc by-sa 3.0 with attribution required.