File tree Expand file tree Collapse file tree 4 files changed +9
-26
lines changed
client/src/main/java/org/asynchttpclient Expand file tree Collapse file tree 4 files changed +9
-26
lines changed Original file line number Diff line number Diff line change 14
14
package org .asynchttpclient .channel ;
15
15
16
16
import java .util .Map ;
17
+ import java .util .function .Predicate ;
17
18
18
19
import io .netty .channel .Channel ;
19
20
@@ -71,7 +72,7 @@ public interface ChannelPool {
71
72
*
72
73
* @param selector the selector
73
74
*/
74
- void flushPartitions (ChannelPoolPartitionSelector selector );
75
+ void flushPartitions (Predicate < Object > selector );
75
76
76
77
/**
77
78
* @return The number of idle channels per host.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 13
13
*/
14
14
package org .asynchttpclient .channel ;
15
15
16
+ import io .netty .channel .Channel ;
17
+
16
18
import java .util .Collections ;
17
19
import java .util .Map ;
18
-
19
- import io .netty .channel .Channel ;
20
+ import java .util .function .Predicate ;
20
21
21
22
public enum NoopChannelPool implements ChannelPool {
22
23
@@ -51,7 +52,7 @@ public void flushPartition(Object partitionKey) {
51
52
}
52
53
53
54
@ Override
54
- public void flushPartitions (ChannelPoolPartitionSelector selector ) {
55
+ public void flushPartitions (Predicate < Object > selector ) {
55
56
}
56
57
57
58
@ Override
Original file line number Diff line number Diff line change 28
28
import java .util .concurrent .TimeUnit ;
29
29
import java .util .concurrent .atomic .AtomicBoolean ;
30
30
import java .util .function .Function ;
31
+ import java .util .function .Predicate ;
31
32
import java .util .stream .Collectors ;
32
33
33
34
import org .asynchttpclient .AsyncHttpClientConfig ;
34
35
import org .asynchttpclient .channel .ChannelPool ;
35
- import org .asynchttpclient .channel .ChannelPoolPartitionSelector ;
36
36
import org .slf4j .Logger ;
37
37
import org .slf4j .LoggerFactory ;
38
38
@@ -358,11 +358,11 @@ public void flushPartition(Object partitionKey) {
358
358
}
359
359
360
360
@ Override
361
- public void flushPartitions (ChannelPoolPartitionSelector selector ) {
361
+ public void flushPartitions (Predicate < Object > selector ) {
362
362
363
363
for (Map .Entry <Object , ConcurrentLinkedDeque <IdleChannel >> partitionsEntry : partitions .entrySet ()) {
364
364
Object partitionKey = partitionsEntry .getKey ();
365
- if (selector .select (partitionKey ))
365
+ if (selector .test (partitionKey ))
366
366
flushPartition (partitionKey , partitionsEntry .getValue ());
367
367
}
368
368
}
You can’t perform that action at this time.
0 commit comments