Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

datasift-java-3.2.14

Latest
Compare
Choose a tag to compare
@zcourts zcourts released this 10 Mar 12:33
· 91 commits to master since this release

Upgrades HTTP client which now creates a custom thread pool so that all threads Netty created are daemons.
This enables the client to shutdown when all non-daemon threads do.

The HTTP client uses a single thread pool for all request, the pool previously wouldn't kill its threads unless it was explicitly told to do so. There is a client.shutdown() method.

This behaviour was found to be confusing by customers so has changed as a result - The client will continue to use a single thread pool for all requests but the threads in the pool are now all daemons, this means that if the main thread and all other non-daemon threads exit, the thread pool will automatically shutdown without the user needing to explicitly do anything.

This new behaviour will see the JVM exit in an example like.

    public static void main(String... args) throws Exception {
        DataSiftConfig config = new DataSiftConfig("<USERNAME>", "<API_KEY>");
        final DataSiftClient datasift = new DataSiftClient(config);
            Stream result = datasift.compile("interaction.sample < 1").sync();
            if (result.isSuccessful()) {
                System.out.println("success " + result);
            } else {
                System.out.println("fail");
            }
    }