Package com.twitter.hbc.twitter4j

Examples of com.twitter.hbc.twitter4j.Twitter4jSitestreamClient


    // calling the listeners on each message
    int numProcessingThreads = 4;
    ExecutorService service = Executors.newFixedThreadPool(numProcessingThreads);

    // Wrap our BasicClient with the twitter4j client
    Twitter4jSitestreamClient t4jClient = new Twitter4jSitestreamClient(
            client, queue, Lists.newArrayList(listener), service);

    // Establish a connection
    t4jClient.connect();
    for (int threads = 0; threads < numProcessingThreads; threads++) {
      // This must be called once per processing thread
      t4jClient.process();
    }

    Thread.sleep(5000);

    // Create a sitestream controller to issue controlstream requests
    SitestreamController controller = new SitestreamController(auth);

    controller.getFriends(t4jClient.getStreamId(), 12345L);
    controller.addUser(t4jClient.getStreamId(), 987765L);

    client.stop();
  }
View Full Code Here

TOP

Related Classes of com.twitter.hbc.twitter4j.Twitter4jSitestreamClient

Copyright © 2018 www.massapicom. 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.