Package com.datasift.client.push

Examples of com.datasift.client.push.PulledInteractions.take()


        datasift.historics().start(historic).sync();

        PulledInteractions historicSubscriptions = datasift.push().pull(historicsSubscription).sync();

        Interaction interaction;
        while (!((interaction = historicSubscriptions.take()) instanceof LastInteraction)) {
            System.out.println(interaction);
        }
        System.out.println("We're done!");
    }
}
View Full Code Here


        // recommended : "take" blocks until some data is fetched, the client automatically continues to pull
        //from DataSift until the subscription is finished or failed for some reason.
        //if you want to stop the automatic fetching call streamSubscriptions.stopPulling();
        //alternatively, use the take(upto,time unit) method to specify the maximum time to wait for interactions to
        //become available
        while (!((interaction = streamSubscriptions.take()) instanceof LastInteraction)) {
            System.out.println(interaction);
        }
        System.out.println("We're done!");
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.