Example usage for twitter4j UserStreamListener onStatus

List of usage examples for twitter4j UserStreamListener onStatus

Introduction

In this page you can find the example usage for twitter4j UserStreamListener onStatus.

Prototype

void onStatus(Status status);

Source Link

Usage

From source file:com.freshdigitable.udonroad.util.TwitterResponseMock.java

License:Apache License

public static void receiveStatuses(final UserStreamListener listener, Status... statuses) throws Exception {
    Observable.just(Arrays.asList(statuses)).flatMapIterable(new Func1<List<Status>, Iterable<Status>>() {
        @Override// w w  w.jav a 2s. c o m
        public Iterable<Status> call(List<Status> statuses) {
            return statuses;
        }
    }).observeOn(Schedulers.io()).subscribe(new Action1<Status>() {
        @Override
        public void call(Status status) {
            listener.onStatus(status);
        }
    });
}