aboutsummaryrefslogtreecommitdiffstats
path: root/vespajlib/src/main/java/com/yahoo/io/SelectLoopHook.java
blob: bcc3c0f3e1d059afa3ca11e88145aff7770659ec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.io;


/**
 * This interface defines a callback hook which applications can
 * use to get work done before or after the select loop finishes
 * its tasks.
 *
 * @author <a href="mailto:borud@yahoo-inc.com">Bjorn Borud</a>
 *
 */
public interface SelectLoopHook {

    /**
     * Callback which can be called before or after
     * select loop has done its work, depending on
     * how you register the hook.
     *
     * @param before is <code>true</code> if the hook
     *        was called before the channels in the ready
     *        set have been processed, and <code>false</code>
     *        if called after.
     */
    public void selectLoopHook(boolean before);
}