Search in sources :

Example 1 with HashedWheelTimer

use of org.apache.dubbo.common.timer.HashedWheelTimer in project dubbo by alibaba.

the class HeartBeatTaskTest method setup.

@BeforeEach
public void setup() throws Exception {
    long tickDuration = 1000;
    heartbeatTimer = new HashedWheelTimer(tickDuration / HEARTBEAT_CHECK_TICK, TimeUnit.MILLISECONDS);
    channel = new MockChannel() {

        @Override
        public URL getUrl() {
            return url;
        }
    };
    AbstractTimerTask.ChannelProvider cp = () -> Collections.<Channel>singletonList(channel);
    heartbeatTimerTask = new HeartbeatTimerTask(cp, tickDuration / HEARTBEAT_CHECK_TICK, (int) tickDuration);
}
Also used : Channel(org.apache.dubbo.remoting.Channel) HashedWheelTimer(org.apache.dubbo.common.timer.HashedWheelTimer) URL(org.apache.dubbo.common.URL) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

URL (org.apache.dubbo.common.URL)1 HashedWheelTimer (org.apache.dubbo.common.timer.HashedWheelTimer)1 Channel (org.apache.dubbo.remoting.Channel)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1