mirror of https://github.com/longtai-cn/hippo4j
Refactor : generic type custom BlockingQueue support (#1036)
* generic refactor. * add customeBlockingQueue generic type support. --------- Co-authored-by: hongdan.qin <hongdan.qin@dmall.com>pull/1073/head
parent
ed875cdf8e
commit
4210e65295
@ -0,0 +1,27 @@
|
||||
package cn.hippo4j.common.spi;
|
||||
|
||||
import cn.hippo4j.common.executor.support.CustomBlockingQueue;
|
||||
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
|
||||
/**
|
||||
* SPI whit generic type test.
|
||||
*/
|
||||
public class MyArrayBlockingQueue implements CustomBlockingQueue<Runnable> {
|
||||
|
||||
@Override
|
||||
public Integer getType() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return this.getClass().getSimpleName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockingQueue<Runnable> generateBlockingQueue() {
|
||||
return new LinkedBlockingQueue<>(20);
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
cn.hippo4j.common.spi.MyArrayBlockingQueue
|
Loading…
Reference in new issue